Skip to content

Commit

Permalink
v 0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanasco committed Oct 17, 2016
1 parent b007585 commit 6baf381
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions demo.py
Expand Up @@ -369,8 +369,8 @@ def initialize_dogpile():
"61jkansd89asd",
)

max_a = 1000000
max_b = 10000
max_a = 1000
max_b = 100
if False:
max_a = max_a/100
max_b = max_a/10
Expand Down
2 changes: 1 addition & 1 deletion dogpile_backend_redis_advanced/__init__.py
@@ -1,6 +1,6 @@
from dogpile.cache.region import register_backend

__version__ = '0.1.3'
__version__ = '0.1.4'

# name, modulepath, objname
register_backend(
Expand Down
19 changes: 10 additions & 9 deletions dogpile_backend_redis_advanced/cache/backends/redis_advanced.py
Expand Up @@ -30,24 +30,25 @@ def default_dumps_factory():
optimized for the cpython compiler. shaves a tiny bit off.
this turns 'pickle_dumps' into a local variable to the dump function.
original:
0 LOAD_GLOBAL 0 (pickle)
0 LOAD_GLOBAL 0 (pickle)
3 LOAD_ATTR 1 (dumps)
6 LOAD_FAST 0 (v)
6 LOAD_GLOBAL 2 (v)
9 LOAD_GLOBAL 0 (pickle)
12 LOAD_ATTR 2 (HIGHEST_PROTOCOL)
12 LOAD_ATTR 3 (HIGHEST_PROTOCOL)
15 CALL_FUNCTION 2
18 RETURN_VALUE
optimized:
0 LOAD_DEREF 0 (dumps)
0 LOAD_DEREF 0 (_dumps)
3 LOAD_FAST 0 (v)
6 LOAD_GLOBAL 0 (pickle)
9 LOAD_ATTR 1 (HIGHEST_PROTOCOL)
12 CALL_FUNCTION 2
15 RETURN_VALUE
6 LOAD_DEREF 1 (_protocol)
9 CALL_FUNCTION 2
12 RETURN_VALUE
"""
_dumps = pickle.dumps
_protocol = pickle.HIGHEST_PROTOCOL
def default_dumps(v):
return _dumps(v, pickle.HIGHEST_PROTOCOL)
return _dumps(v, _protocol)
return default_dumps
default_dumps = default_dumps_factory()

Expand Down

0 comments on commit 6baf381

Please sign in to comment.