[Python-checkins] cpython (3.3): Set cache sizes to a power-of-two
raymond.hettinger
python-checkins at python.org
Sun Feb 17 10:34:52 CET 2013
http://hg.python.org/cpython/rev/4ab91904f232
changeset: 82239:4ab91904f232
branch: 3.3
parent: 82236:0f65bf6063ca
user: Raymond Hettinger <python at rcn.com>
date: Sun Feb 17 01:33:37 2013 -0800
summary:
Set cache sizes to a power-of-two
files:
Lib/fnmatch.py | 2 +-
Lib/re.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Lib/fnmatch.py b/Lib/fnmatch.py
--- a/Lib/fnmatch.py
+++ b/Lib/fnmatch.py
@@ -35,7 +35,7 @@
pat = os.path.normcase(pat)
return fnmatchcase(name, pat)
- at functools.lru_cache(maxsize=250, typed=True)
+ at functools.lru_cache(maxsize=256, typed=True)
def _compile_pattern(pat):
if isinstance(pat, bytes):
pat_str = str(pat, 'ISO-8859-1')
diff --git a/Lib/re.py b/Lib/re.py
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -261,7 +261,7 @@
_pattern_type = type(sre_compile.compile("", 0))
- at functools.lru_cache(maxsize=500, typed=True)
+ at functools.lru_cache(maxsize=512, typed=True)
def _compile(pattern, flags):
# internal: compile pattern
if isinstance(pattern, _pattern_type):
@@ -273,7 +273,7 @@
raise TypeError("first argument must be string or compiled pattern")
return sre_compile.compile(pattern, flags)
- at functools.lru_cache(maxsize=500)
+ at functools.lru_cache(maxsize=512)
def _compile_repl(repl, pattern):
# internal: compile replacement pattern
return sre_parse.parse_template(repl, pattern)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list