Increase the maximum number of object streams in a file (Issue #58) - most files

only contain 1 or 2...

Change the implementation of add/find object to use a custom binary insertion
sort algorithm rather than doing a qsort after every addition.  This results in
a significant improvement in open speed - from 2371 seconds (about 39.5 minutes)
to 3.1 seconds for one large test file (an ESRI standard).
This commit is contained in:
Michael R Sweet
2023-12-13 12:21:59 -05:00
parent 2b92044504
commit 2a85baaf81
3 changed files with 107 additions and 36 deletions

View File

@ -266,7 +266,8 @@ struct _pdfio_file_s // PDF file structure
alloc_dicts; // Allocated dictionaries
pdfio_dict_t **dicts; // Dictionaries
size_t num_objs, // Number of objects
alloc_objs; // Allocated objects
alloc_objs, // Allocated objects
last_obj; // Last object added
pdfio_obj_t **objs, // Objects
*current_obj; // Current object being written/read
size_t num_objmaps, // Number of object maps