Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:07:06) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from fastcache import benchmark
>>> benchmark.run()
Test Suite 1 :
Primarily tests cost of function call, hashing and cache hits.
Benchmark script based on
http://bugs.python.org/file28400/lru_cache_bench.py
function call speed up
untyped(i) 0.53, typed(i) 0.63
untyped("spam", i) 0.51, typed("spam", i) 0.67
untyped("spam", "spam", i) 0.57, typed("spam", "spam", i) 0.63
untyped(a=i) 0.87, typed(a=i) 0.89
untyped(a="spam", b=i) 1.01, typed(a="spam", b=i) 1.04
untyped(a="spam", b="spam", c=i) 1.17, typed(a="spam", b="spam", c=i) 1.08
min mean max
untyped 0.508 0.776 1.171
typed 0.632 0.824 1.080
Test Suite 2 :
Tests millions of misses and millions of hits to quantify
cache behavior when cache is full.
function call speed up
untyped(i, j, a="spammy") 0.93, typed(i, j, a="spammy") 0.92
>>>