fix(parser): Improving CSS selecting memory usage by ~144%

and speed by ~2%
This commit is contained in:
Karim shoair
2025-03-16 22:33:46 +02:00
parent ed89161cd9
commit e5a022ec6a
2 changed files with 6 additions and 3 deletions
+3
View File
@@ -142,3 +142,6 @@ class HTMLTranslator(TranslatorMixin, OriginalHTMLTranslator):
@lru_cache(maxsize=256)
def css_to_xpath(self, css: str, prefix: str = "descendant-or-self::") -> str:
return super().css_to_xpath(css, prefix)
translator_instance = HTMLTranslator()