Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch: json-decoder-maps
Changeset: r97544:434116a59d15
Date: 2019-09-19 19:54 +0200
http://bitbucket.org/pypy/pypy/changeset/434116a59d15/

Log:    explain MIN_SIZE_FOR_STRING_CACHE

diff --git a/pypy/module/_pypyjson/interp_decoder.py 
b/pypy/module/_pypyjson/interp_decoder.py
--- a/pypy/module/_pypyjson/interp_decoder.py
+++ b/pypy/module/_pypyjson/interp_decoder.py
@@ -59,7 +59,10 @@
 
     DEFAULT_SIZE_SCRATCH = 20
 
-    # <antocuni> put a comment explaining what it does and why this is a 
reasonable number
+    # string caching is only used if the total size of the message is larger
+    # than a megabyte. Below that, there can't be that many repeated big
+    # strings anyway (some experiments showed this to be a reasonable cutoff
+    # size)
     MIN_SIZE_FOR_STRING_CACHE = 1024 * 1024
 
     # evaluate the string cache for 200 strings, before looking at the hit rate
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to