From 319c9d2315ad4fb13abe423571311ddb63202e2c Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 29 Dec 2014 19:07:48 +0000 Subject: Performance optimisation with pdf_cache_object/pdf_get_xref_entry The recent change to holding pdf xrefs in a sparse format has resulted in a significant decrease in speed (x10). Malc points out that some of this (2x) can be recovered simply by making pdf_cache_object return the entry which it found the object in. This saves us having to immediately call pdf_get_xref_entry again afterwards. I am still thinking about ways to try and get the remaining time back. --- include/mupdf/pdf/xref.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/mupdf/pdf/xref.h') diff --git a/include/mupdf/pdf/xref.h b/include/mupdf/pdf/xref.h index 70826314..ac8525ac 100644 --- a/include/mupdf/pdf/xref.h +++ b/include/mupdf/pdf/xref.h @@ -66,7 +66,7 @@ struct pdf_xref_s pdf_obj *pre_repair_trailer; }; -void pdf_cache_object(pdf_document *doc, int num, int gen); +pdf_xref_entry *pdf_cache_object(pdf_document *doc, int num, int gen); int pdf_count_objects(pdf_document *doc); pdf_obj *pdf_resolve_indirect(pdf_obj *ref); -- cgit v1.2.3