diff --git a/dissect/esedb/esedb.py b/dissect/esedb/esedb.py index c22f599..479ecfe 100755 --- a/dissect/esedb/esedb.py +++ b/dissect/esedb/esedb.py @@ -45,6 +45,8 @@ def __init__(self, fh: BinaryIO, impacket_compat: bool = False): self.catalog = Catalog(self, pgnoFDPMSO) + self.page = lru_cache(4096)(self.page) + @cached_property def has_small_pages(self) -> bool: """Return whether this database has small pages (<= 8K).""" @@ -82,7 +84,6 @@ def read_page(self, num: int) -> bytes: return buf - @lru_cache(maxsize=4096) def page(self, num: int) -> Page: """Get a logical page. diff --git a/dissect/esedb/record.py b/dissect/esedb/record.py index 94e2780..838bc67 100644 --- a/dissect/esedb/record.py +++ b/dissect/esedb/record.py @@ -151,6 +151,9 @@ def __init__(self, table: Table, node: Node): self._tagged_data_view = xmemoryview(tagged_field_data, " RecordValue: """Retrieve the value for the specified column. @@ -355,12 +358,10 @@ def _get_tagged(self, column: Column) -> Optional[bytes]: return tag_field, value - @lru_cache(4096) def _get_tag_field(self, idx: int) -> TagField: """Retrieve the :class:`TagField` at the given index in the ``TAGFLD`` array.""" return TagField(self, self._tagged_data_view[idx]) - @lru_cache(4096) def _find_tag_field_idx(self, identifier: int, is_derived: bool = False) -> Optional[TagField]: """Find a tag field by identifier and optional derived flag.