From 5e609b2a17a918b86e467a683a2f578acd45c77a Mon Sep 17 00:00:00 2001 From: brokkoli71 Date: Fri, 14 Aug 2026 19:02:38 +0200 Subject: [PATCH] Remove the debug timing loop from Annot.update() Annot.update() unconditionally calls Annot.update_timing_test(), a static method that counts to 30,000 in pure Python and returns a sum the caller discards. It costs about 0.68 ms per annotation. The method is undocumented and had no other callers, so it is removed along with the call. --- src/__init__.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/__init__.py b/src/__init__.py index 1a9e22003..bbfa31abc 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1625,7 +1625,6 @@ def update(self, is_rich_text = mupdf.pdf_dict_get(annot_obj, PDF_NAME("RC")) if not is_rich_text: raise ValueError("cannot set border_color if rich_text is False") - Annot.update_timing_test() CheckParent(self) def color_string(cs, code): """Return valid PDF color operator for a given color sequence. @@ -1887,13 +1886,6 @@ def update_file(self, buffer_=None, filename=None, ufilename=None, desc=None): mupdf.pdf_dict_put_text_string(stream, PDF_NAME('Desc'), desc) mupdf.pdf_dict_put_text_string(fs, PDF_NAME('Desc'), desc) - @staticmethod - def update_timing_test(): - total = 0 - for i in range( 30*1000): - total += i - return total - @property def vertices(self): """annotation vertex points"""