Skip to content

Releases: deliro/moka-py

0.1.16

23 Jan 20:28
Compare
Choose a tag to compare

0.1.15

16 Dec 09:31
Compare
Choose a tag to compare
  • add remove default option
  • speed up gets ~40%
  • update docs

Full Changelog: 0.1.14...0.1.15

0.1.14

16 Dec 07:46
Compare
Choose a tag to compare
  • Add policy choosing (TinyLFU/LRU)

Full Changelog: 0.1.13...0.1.14

0.1.13

11 Dec 19:51
Compare
Choose a tag to compare

0.1.12

06 Dec 09:15
Compare
Choose a tag to compare

Added eviction listener support

Full Changelog: 0.1.11...0.1.12

0.1.11

03 Dec 22:15
Compare
Choose a tag to compare

Full Changelog: 0.1.10...0.1.11

0.1.10

02 Dec 20:45
Compare
Choose a tag to compare

Changes:

  • Add default argument to Moka.get(key, default=None)

Full Changelog: 0.1.9...0.1.10

0.1.9

01 Dec 21:53
Compare
Choose a tag to compare

This release contains several approaches to speed up moka-py

Summary:

  • Moka.get x1.21 speed up on hits (not misses)
  • Moka.get x0.87 slow down on misses (I believe you have more than 50% cache hit rate)
  • Moka.get_with x1.3 speed up
  • Moka.set x1.1 speed up
  • GIL is relaxed in several points to speed up multithreaded environments

Benchmarks:

Before:

------------------------------------------------------------------------------------------- benchmark: 5 tests -------------------------------------------------------------------------------------------
Name (time in ns)                    Min                 Max                Mean             StdDev              Median                IQR            Outliers  OPS (Mops/s)            Rounds  Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_bench_get_non_existent     179.6285 (1.0)      180.8282 (1.0)      180.1620 (1.0)       0.5334 (2.35)     180.0952 (1.0)       0.9733 (2.57)          2;0        5.5506 (1.0)           5    10000000
test_bench_get                  272.2006 (1.52)     276.4753 (1.53)     273.2286 (1.52)      1.8217 (8.03)     272.5346 (1.51)      1.2622 (3.33)          1;1        3.6599 (0.66)          5     1837011
test_bench_get_with             324.1755 (1.80)     324.6700 (1.80)     324.4797 (1.80)      0.2269 (1.0)      324.6167 (1.80)      0.3793 (1.0)           1;0        3.0819 (0.56)          5     1541716
test_bench_set_huge             786.8319 (4.38)     812.0210 (4.49)     794.3915 (4.41)     10.2194 (45.04)    789.7347 (4.39)     10.1896 (26.87)         1;0        1.2588 (0.23)          5     1000000
test_bench_set                  812.6144 (4.52)     829.8675 (4.59)     821.4320 (4.56)      7.5132 (33.12)    824.9048 (4.58)     12.5326 (33.04)         2;0        1.2174 (0.22)          5     1000000
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

After:

------------------------------------------------------------------------------------------- benchmark: 5 tests -------------------------------------------------------------------------------------------
Name (time in ns)                    Min                 Max                Mean             StdDev              Median                IQR            Outliers  OPS (Mops/s)            Rounds  Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_bench_get_non_existent     206.3389 (1.0)      208.9872 (1.0)      207.0240 (1.0)       1.1154 (4.27)     206.5119 (1.0)       0.9932 (2.73)          1;1        4.8304 (1.0)           5    10000000
test_bench_get                  224.4981 (1.09)     229.1849 (1.10)     225.8305 (1.09)      1.9252 (7.37)     224.9832 (1.09)      1.8345 (5.05)          1;0        4.4281 (0.92)          5    10000000
test_bench_get_with             248.2484 (1.20)     248.9123 (1.19)     248.5142 (1.20)      0.2612 (1.0)      248.5172 (1.20)      0.3634 (1.0)           2;0        4.0239 (0.83)          5     2020760
test_bench_set_huge             676.6090 (3.28)     692.0143 (3.31)     683.5817 (3.30)      6.5151 (24.94)    684.8168 (3.32)     10.9585 (30.16)         2;0        1.4629 (0.30)          5     1000000
test_bench_set                  723.4063 (3.51)     770.0967 (3.68)     738.1940 (3.57)     18.5167 (70.89)    733.0997 (3.55)     18.1077 (49.83)         1;0        1.3547 (0.28)          5     1000000
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Full Changelog: 0.1.8...0.1.9

0.1.8

29 Nov 12:08
Compare
Choose a tag to compare
  • Add Moka.get_with method to synchronize concurrent access to keys from multiple threads
  • Add with_concurrent=True option to moka_py.cached() decorator that takes care of concurrent access from multiple threads

Full Changelog: 0.1.7...0.1.8

0.1.7

27 Nov 08:59
Compare
Choose a tag to compare

Full Changelog: 0.1.6...0.1.7