• Kirill Smelkov's avatar
    X zodb/cache: Kill cache-gc tracepoint · 13f149f0
    Kirill Smelkov authored
    On NoHit workloads gc is invoked for every load and since cache's goal
    is to provide minimum slowdown the tracepoint overhead becomes visible.
    
    Cache gc tracepoints were initially added for testing - to be able to
    wait for gc to start/finish - when gc was running in its own goroutine,
    but now, after 0e2be3b3 (X zodb/cache: Performing GC in separate
    goroutine was actually a bad idea), when gc is running synchronously
    there is need for this tracing events even from testing point of view.
    
    So remove them.
    
    ---- 8< ----
    
    name                        old time/op    new time/op    delta
    NoopStorage                   57.9ns ± 1%    56.6ns ± 1%   -2.30%  (p=0.100 n=3+3)
    NoopStorage-4                 57.4ns ± 1%    56.4ns ± 0%   -1.68%  (p=0.100 n=3+3)
    CacheStartup                  2.13µs ±16%    1.95µs ± 2%     ~     (p=0.700 n=3+3)
    CacheStartup-4                1.29µs ± 4%    1.31µs ± 5%     ~     (p=0.700 n=3+3)
    CacheNoHit/size=0              677ns ± 1%     590ns ± 1%  -12.86%  (p=0.100 n=3+3)
    CacheNoHit/size=0-4            664ns ± 1%     591ns ± 1%  -11.04%  (p=0.100 n=3+3)
    CacheNoHit/size=16             792ns ± 0%     707ns ± 0%  -10.81%  (p=0.100 n=3+3)
    CacheNoHit/size=16-4           788ns ± 0%     711ns ± 1%   -9.85%  (p=0.100 n=3+3)
    CacheNoHit/size=128            796ns ± 0%     717ns ± 0%   -9.93%  (p=0.100 n=3+3)
    CacheNoHit/size=128-4          795ns ± 1%     716ns ± 0%   -9.86%  (p=0.100 n=3+3)
    CacheNoHit/size=512            816ns ± 0%     737ns ± 0%   -9.69%  (p=0.100 n=3+3)
    CacheNoHit/size=512-4          803ns ± 0%     721ns ± 0%  -10.25%  (p=0.100 n=3+3)
    CacheNoHit/size=4096          1.05µs ± 1%    0.95µs ± 1%  -10.13%  (p=0.100 n=3+3)
    CacheNoHit/size=4096-4         856ns ± 0%     780ns ± 1%   -8.91%  (p=0.100 n=3+3)
    CacheHit/size=0                664ns ± 0%     589ns ± 1%  -11.34%  (p=0.100 n=3+3)
    CacheHit/size=0-4              660ns ± 0%     588ns ± 0%  -10.86%  (p=0.100 n=3+3)
    CacheHit/size=16               123ns ± 4%     122ns ± 1%     ~     (p=0.800 n=3+3)
    CacheHit/size=16-4             121ns ± 1%     123ns ± 1%     ~     (p=0.300 n=3+3)
    CacheHit/size=128              124ns ± 1%     127ns ± 2%   +2.70%  (p=0.100 n=3+3)
    CacheHit/size=128-4            124ns ± 1%     126ns ± 1%   +2.16%  (p=0.100 n=3+3)
    CacheHit/size=512              126ns ± 1%     128ns ± 2%     ~     (p=0.400 n=3+3)
    CacheHit/size=512-4            125ns ± 1%     127ns ± 1%   +1.60%  (p=0.100 n=3+3)
    CacheHit/size=4096             127ns ± 1%     130ns ± 0%   +2.09%  (p=0.100 n=3+3)
    CacheHit/size=4096-4           128ns ± 1%     130ns ± 1%   +1.56%  (p=0.100 n=3+3)
    NoopStoragePar                59.2ns ± 1%    59.7ns ± 3%     ~     (p=1.000 n=3+3)
    NoopStoragePar-4              31.2ns ± 8%    31.3ns ± 8%     ~     (p=1.000 n=3+3)
    CacheStartupPar               2.04µs ± 6%    1.97µs ±13%     ~     (p=1.000 n=3+3)
    CacheStartupPar-4             1.48µs ± 3%    1.49µs ± 4%     ~     (p=0.700 n=3+3)
    CacheNoHitPar/size=0           670ns ± 0%     591ns ± 0%  -11.75%  (p=0.100 n=3+3)
    CacheNoHitPar/size=0-4         904ns ± 0%     811ns ± 0%  -10.32%  (p=0.100 n=3+3)
    CacheNoHitPar/size=16          789ns ± 0%     713ns ± 0%   -9.63%  (p=0.100 n=3+3)
    CacheNoHitPar/size=16-4       1.03µs ± 0%    0.92µs ± 0%  -10.06%  (p=0.100 n=3+3)
    CacheNoHitPar/size=128         800ns ± 0%     717ns ± 0%  -10.45%  (p=0.100 n=3+3)
    CacheNoHitPar/size=128-4      1.04µs ± 0%    0.95µs ± 0%   -8.63%  (p=0.100 n=3+3)
    CacheNoHitPar/size=512         818ns ± 0%     733ns ± 0%  -10.35%  (p=0.100 n=3+3)
    CacheNoHitPar/size=512-4      1.07µs ± 0%    0.97µs ± 0%   -9.04%  (p=0.100 n=3+3)
    CacheNoHitPar/size=4096       1.06µs ± 1%    0.94µs ± 0%  -11.50%  (p=0.100 n=3+3)
    CacheNoHitPar/size=4096-4     1.17µs ± 1%    1.07µs ± 0%   -7.89%  (p=0.100 n=3+3)
    CacheHitPar/size=0             665ns ± 0%     587ns ± 0%  -11.69%  (p=0.100 n=3+3)
    CacheHitPar/size=0-4           903ns ± 1%     805ns ± 0%  -10.85%  (p=0.100 n=3+3)
    CacheHitPar/size=16            124ns ± 1%     122ns ± 1%     ~     (p=0.200 n=3+3)
    CacheHitPar/size=16-4          217ns ± 1%     236ns ± 1%   +8.74%  (p=0.100 n=3+3)
    CacheHitPar/size=128           125ns ± 0%     125ns ± 1%     ~     (p=1.000 n=3+3)
    CacheHitPar/size=128-4         215ns ± 1%     220ns ± 0%   +2.48%  (p=0.100 n=3+3)
    CacheHitPar/size=512           127ns ± 1%     127ns ± 2%     ~     (p=0.600 n=3+3)
    CacheHitPar/size=512-4         241ns ± 0%     219ns ± 0%   -9.14%  (p=0.100 n=3+3)
    CacheHitPar/size=4096          129ns ± 0%     129ns ± 1%     ~     (p=1.000 n=3+3)
    CacheHitPar/size=4096-4        236ns ± 4%     223ns ± 5%     ~     (p=0.200 n=3+3)
    NoopStorageProc               56.1ns ± 0%    54.7ns ± 0%   -2.44%  (p=0.100 n=3+3)
    NoopStorageProc-4             37.1ns ±10%    31.8ns ± 4%  -14.45%  (p=0.100 n=3+3)
    CacheStartupProc              1.79µs ± 3%    1.88µs ±11%     ~     (p=0.700 n=3+3)
    CacheStartupProc-4            1.08µs ± 7%    1.13µs ± 3%     ~     (p=0.400 n=3+3)
    CacheNoHitProc/size=0          669ns ± 0%     598ns ± 0%  -10.66%  (p=0.100 n=3+3)
    CacheNoHitProc/size=0-4        414ns ±15%     309ns ± 0%  -25.38%  (p=0.100 n=3+3)
    CacheNoHitProc/size=16         792ns ± 0%     711ns ± 0%  -10.27%  (p=0.100 n=3+3)
    CacheNoHitProc/size=16-4       440ns ± 7%     356ns ± 0%  -19.02%  (p=0.100 n=3+3)
    CacheNoHitProc/size=128        808ns ± 0%     722ns ± 1%  -10.61%  (p=0.100 n=3+3)
    CacheNoHitProc/size=128-4      467ns ± 8%     363ns ± 0%  -22.29%  (p=0.100 n=3+3)
    CacheNoHitProc/size=512        834ns ± 1%     741ns ± 1%  -11.08%  (p=0.100 n=3+3)
    CacheNoHitProc/size=512-4      499ns ± 9%     394ns ± 0%  -20.98%  (p=0.100 n=3+3)
    CacheNoHitProc/size=4096      1.07µs ± 0%    0.94µs ± 0%  -11.71%  (p=0.100 n=3+3)
    CacheNoHitProc/size=4096-4     629ns ± 3%     565ns ± 0%  -10.12%  (p=0.100 n=3+3)
    CacheHitProc/size=0            669ns ± 0%     598ns ± 0%  -10.61%  (p=0.100 n=3+3)
    CacheHitProc/size=0-4          381ns ± 2%     310ns ± 0%  -18.72%  (p=0.100 n=3+3)
    CacheHitProc/size=16           121ns ± 1%     120ns ± 1%     ~     (p=0.400 n=3+3)
    CacheHitProc/size=16-4        65.0ns ± 3%    57.5ns ± 2%  -11.59%  (p=0.100 n=3+3)
    CacheHitProc/size=128          124ns ± 0%     123ns ± 1%     ~     (p=0.700 n=3+3)
    CacheHitProc/size=128-4       74.9ns ± 3%    58.1ns ± 0%  -22.44%  (p=0.100 n=3+3)
    CacheHitProc/size=512          125ns ± 1%     126ns ± 2%     ~     (p=0.600 n=3+3)
    CacheHitProc/size=512-4       71.5ns ± 2%    58.6ns ± 0%  -17.96%  (p=0.100 n=3+3)
    CacheHitProc/size=4096         132ns ± 6%     128ns ± 1%     ~     (p=0.600 n=3+3)
    CacheHitProc/size=4096-4      80.5ns ± 7%    69.8ns ± 0%  -13.30%  (p=0.100 n=3+3)
    
    name                        old alloc/op   new alloc/op   delta
    NoopStorage                    0.00B          0.00B          ~     (all equal)
    NoopStorage-4                  0.00B          0.00B          ~     (all equal)
    CacheStartup                    285B ± 0%      285B ± 0%     ~     (all equal)
    CacheStartup-4                  285B ± 0%      285B ± 0%     ~     (all equal)
    CacheNoHit/size=0               152B ± 0%      152B ± 0%     ~     (all equal)
    CacheNoHit/size=0-4             152B ± 0%      152B ± 0%     ~     (all equal)
    CacheNoHit/size=16              153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHit/size=16-4            153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHit/size=128             153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHit/size=128-4           153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHit/size=512             153B ± 0%      153B ± 0%     ~     (p=1.000 n=3+3)
    CacheNoHit/size=512-4           153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHit/size=4096            153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHit/size=4096-4          152B ± 0%      153B ± 0%     ~     (p=1.000 n=3+3)
    CacheHit/size=0                 152B ± 0%      152B ± 0%     ~     (all equal)
    CacheHit/size=0-4               152B ± 0%      152B ± 0%     ~     (all equal)
    CacheHit/size=16               0.00B          0.00B          ~     (all equal)
    CacheHit/size=16-4             0.00B          0.00B          ~     (all equal)
    CacheHit/size=128              0.00B          0.00B          ~     (all equal)
    CacheHit/size=128-4            0.00B          0.00B          ~     (all equal)
    CacheHit/size=512              0.00B          0.00B          ~     (all equal)
    CacheHit/size=512-4            0.00B          0.00B          ~     (all equal)
    CacheHit/size=4096             0.00B          0.00B          ~     (all equal)
    CacheHit/size=4096-4           0.00B          0.00B          ~     (all equal)
    NoopStoragePar                 0.00B          0.00B          ~     (all equal)
    NoopStoragePar-4               0.00B          0.00B          ~     (all equal)
    CacheStartupPar                 285B ± 0%      285B ± 0%     ~     (all equal)
    CacheStartupPar-4               281B ± 0%      282B ± 0%     ~     (p=0.300 n=3+3)
    CacheNoHitPar/size=0            152B ± 0%      152B ± 0%     ~     (all equal)
    CacheNoHitPar/size=0-4          152B ± 0%      152B ± 0%     ~     (all equal)
    CacheNoHitPar/size=16           153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitPar/size=16-4         155B ± 0%      154B ± 0%     ~     (p=0.400 n=3+3)
    CacheNoHitPar/size=128          153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitPar/size=128-4        153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitPar/size=512          153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitPar/size=512-4        153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitPar/size=4096         153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitPar/size=4096-4       153B ± 0%      153B ± 0%     ~     (all equal)
    CacheHitPar/size=0              152B ± 0%      152B ± 0%     ~     (all equal)
    CacheHitPar/size=0-4            152B ± 0%      152B ± 0%     ~     (all equal)
    CacheHitPar/size=16            0.00B          0.00B          ~     (all equal)
    CacheHitPar/size=16-4          0.00B          0.00B          ~     (all equal)
    CacheHitPar/size=128           0.00B          0.00B          ~     (all equal)
    CacheHitPar/size=128-4         0.00B          0.00B          ~     (all equal)
    CacheHitPar/size=512           0.00B          0.00B          ~     (all equal)
    CacheHitPar/size=512-4         0.00B          0.00B          ~     (all equal)
    CacheHitPar/size=4096          0.00B          0.00B          ~     (all equal)
    CacheHitPar/size=4096-4        0.00B          0.00B          ~     (all equal)
    NoopStorageProc                0.00B          0.00B          ~     (all equal)
    NoopStorageProc-4              0.00B          0.00B          ~     (all equal)
    CacheStartupProc                285B ± 0%      285B ± 0%     ~     (all equal)
    CacheStartupProc-4              285B ± 0%      285B ± 0%     ~     (all equal)
    CacheNoHitProc/size=0           152B ± 0%      152B ± 0%     ~     (all equal)
    CacheNoHitProc/size=0-4         152B ± 0%      152B ± 0%     ~     (all equal)
    CacheNoHitProc/size=16          153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitProc/size=16-4        153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitProc/size=128         153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitProc/size=128-4       153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitProc/size=512         153B ± 0%      153B ± 0%     ~     (p=1.000 n=3+3)
    CacheNoHitProc/size=512-4       153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitProc/size=4096        153B ± 0%      153B ± 0%     ~     (all equal)
    CacheNoHitProc/size=4096-4      153B ± 0%      153B ± 0%     ~     (all equal)
    CacheHitProc/size=0             152B ± 0%      152B ± 0%     ~     (all equal)
    CacheHitProc/size=0-4           152B ± 0%      152B ± 0%     ~     (all equal)
    CacheHitProc/size=16           0.00B          0.00B          ~     (all equal)
    CacheHitProc/size=16-4         0.00B          0.00B          ~     (all equal)
    CacheHitProc/size=128          0.00B          0.00B          ~     (all equal)
    CacheHitProc/size=128-4        0.00B          0.00B          ~     (all equal)
    CacheHitProc/size=512          0.00B          0.00B          ~     (all equal)
    CacheHitProc/size=512-4        0.00B          0.00B          ~     (all equal)
    CacheHitProc/size=4096         0.00B          0.00B          ~     (all equal)
    CacheHitProc/size=4096-4       0.00B          0.00B          ~     (all equal)
    
    name                        old allocs/op  new allocs/op  delta
    NoopStorage                     0.00           0.00          ~     (all equal)
    NoopStorage-4                   0.00           0.00          ~     (all equal)
    CacheStartup                    5.00 ± 0%      5.00 ± 0%     ~     (all equal)
    CacheStartup-4                  5.00 ± 0%      5.00 ± 0%     ~     (all equal)
    CacheNoHit/size=0               3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHit/size=0-4             3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHit/size=16              3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHit/size=16-4            3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHit/size=128             3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHit/size=128-4           3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHit/size=512             3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHit/size=512-4           3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHit/size=4096            3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHit/size=4096-4          3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheHit/size=0                 3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheHit/size=0-4               3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheHit/size=16                0.00           0.00          ~     (all equal)
    CacheHit/size=16-4              0.00           0.00          ~     (all equal)
    CacheHit/size=128               0.00           0.00          ~     (all equal)
    CacheHit/size=128-4             0.00           0.00          ~     (all equal)
    CacheHit/size=512               0.00           0.00          ~     (all equal)
    CacheHit/size=512-4             0.00           0.00          ~     (all equal)
    CacheHit/size=4096              0.00           0.00          ~     (all equal)
    CacheHit/size=4096-4            0.00           0.00          ~     (all equal)
    NoopStoragePar                  0.00           0.00          ~     (all equal)
    NoopStoragePar-4                0.00           0.00          ~     (all equal)
    CacheStartupPar                 5.00 ± 0%      5.00 ± 0%     ~     (all equal)
    CacheStartupPar-4               4.00 ± 0%      4.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=0            3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=0-4          3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=16           3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=16-4         3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=128          3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=128-4        3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=512          3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=512-4        3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=4096         3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitPar/size=4096-4       3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheHitPar/size=0              3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheHitPar/size=0-4            3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheHitPar/size=16             0.00           0.00          ~     (all equal)
    CacheHitPar/size=16-4           0.00           0.00          ~     (all equal)
    CacheHitPar/size=128            0.00           0.00          ~     (all equal)
    CacheHitPar/size=128-4          0.00           0.00          ~     (all equal)
    CacheHitPar/size=512            0.00           0.00          ~     (all equal)
    CacheHitPar/size=512-4          0.00           0.00          ~     (all equal)
    CacheHitPar/size=4096           0.00           0.00          ~     (all equal)
    CacheHitPar/size=4096-4         0.00           0.00          ~     (all equal)
    NoopStorageProc                 0.00           0.00          ~     (all equal)
    NoopStorageProc-4               0.00           0.00          ~     (all equal)
    CacheStartupProc                5.00 ± 0%      5.00 ± 0%     ~     (all equal)
    CacheStartupProc-4              5.00 ± 0%      5.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=0           3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=0-4         3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=16          3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=16-4        3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=128         3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=128-4       3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=512         3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=512-4       3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=4096        3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheNoHitProc/size=4096-4      3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheHitProc/size=0             3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheHitProc/size=0-4           3.00 ± 0%      3.00 ± 0%     ~     (all equal)
    CacheHitProc/size=16            0.00           0.00          ~     (all equal)
    CacheHitProc/size=16-4          0.00           0.00          ~     (all equal)
    CacheHitProc/size=128           0.00           0.00          ~     (all equal)
    CacheHitProc/size=128-4         0.00           0.00          ~     (all equal)
    CacheHitProc/size=512           0.00           0.00          ~     (all equal)
    CacheHitProc/size=512-4         0.00           0.00          ~     (all equal)
    CacheHitProc/size=4096          0.00           0.00          ~     (all equal)
    CacheHitProc/size=4096-4        0.00           0.00          ~     (all equal)
    13f149f0
cache_test.go 22.6 KB