Skip to content

Commit

Permalink
Use an LRU cache for guess_type
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Sep 17, 2024
1 parent a700b3f commit ade0f07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/calibre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _init_mimetypes():
_mt_inited = True


@lru_cache(4096)
def guess_type(*args, **kwargs):
import mimetypes
if not _mt_inited:
Expand Down

0 comments on commit ade0f07

Please sign in to comment.