Skip to content

Instantly share code, notes, and snippets.

@armsnyder
Created February 10, 2023 11:06
Show Gist options
  • Save armsnyder/40aca6ea480bf53434d1e41c663e1550 to your computer and use it in GitHub Desktop.
Save armsnyder/40aca6ea480bf53434d1e41c663e1550 to your computer and use it in GitHub Desktop.
go-redis context fix benchmark comparison
goos: darwin
goarch: arm64
pkg: github.com/redis/go-redis/v9
│ 345ad759.bench.txt │ dadcdcf2.bench.txt │
│ sec/op │ sec/op vs base │
Decode/RespError-server-10 425.2n ± 2% 1252.0n ± 0% +194.48% (p=0.002 n=6)
Decode/RespStatus-server-10 414.2n ± 1% 1254.0n ± 0% +202.79% (p=0.002 n=6)
Decode/RespInt-server-10 372.2n ± 1% 1182.0n ± 0% +217.53% (p=0.002 n=6)
Decode/RespString-server-10 385.8n ± 1% 1206.5n ± 2% +212.77% (p=0.002 n=6)
Decode/RespArray-server-10 530.5n ± 1% 1456.5n ± 0% +174.58% (p=0.002 n=6)
Decode/RespPipeline-server-10 941.1n ± 1% 2087.5n ± 1% +121.80% (p=0.002 n=6)
Decode/RespTxPipeline-server-10 1.314µ ± 0% 2.631µ ± 1% +100.23% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=5-10 1.375µ ± 3% 1.524µ ± 19% +10.87% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=20-10 1.358µ ± 14% 1.471µ ± 4% ~ (p=0.310 n=6)
Decode/DynamicGoroutine-server-pool=50-10 1.284µ ± 17% 1.398µ ± 10% +8.88% (p=0.041 n=6)
Decode/DynamicGoroutine-server-pool=100-10 1.286µ ± 2% 1.389µ ± 1% +8.01% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=5-10 494.8n ± 10% 916.0n ± 11% +85.11% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=20-10 880.7n ± 3% 1131.5n ± 2% +28.48% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=50-10 971.0n ± 4% 1209.0n ± 6% +24.51% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=100-10 1.015µ ± 4% 1.268µ ± 1% +24.88% (p=0.002 n=6)
Decode/RespError-cluster-10 587.9n ± 4% 1500.5n ± 2% +155.21% (p=0.002 n=6)
Decode/RespStatus-cluster-10 557.5n ± 3% 1447.5n ± 1% +159.64% (p=0.002 n=6)
Decode/RespInt-cluster-10 491.4n ± 3% 1368.0n ± 1% +178.39% (p=0.002 n=6)
Decode/RespString-cluster-10 502.5n ± 6% 1397.0n ± 1% +178.04% (p=0.002 n=6)
Decode/RespArray-cluster-10 650.6n ± 5% 1561.0n ± 1% +139.91% (p=0.002 n=6)
Decode/RespPipeline-cluster-10 3.710µ ± 2% 5.859µ ± 1% +57.93% (p=0.002 n=6)
Decode/RespTxPipeline-cluster-10 4.328µ ± 5% 5.937µ ± 4% +37.16% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=5-10 1.435µ ± 9% 1.622µ ± 9% +13.07% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=20-10 1.360µ ± 15% 1.546µ ± 11% +13.64% (p=0.041 n=6)
Decode/DynamicGoroutine-cluster-pool=50-10 1.287µ ± 16% 1.463µ ± 16% ~ (p=0.093 n=6)
Decode/DynamicGoroutine-cluster-pool=100-10 1.363µ ± 20% 1.507µ ± 24% ~ (p=0.180 n=6)
Decode/StaticGoroutine-cluster-pool=5-10 522.9n ± 15% 990.6n ± 9% +89.46% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=20-10 933.6n ± 16% 1117.5n ± 11% +19.70% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=50-10 990.2n ± 14% 1239.0n ± 6% +25.13% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=100-10 966.7n ± 10% 1239.5n ± 8% +28.23% (p=0.002 n=6)
RingShardingRebalanceLocked-10 5.386µ ± 6% 5.330µ ± 9% ~ (p=0.394 n=6)
RedisPing-10 6.399µ ± 70% 6.995µ ± 58% ~ (p=0.132 n=6)
SetGoroutines-10 7.302m ± 61% 7.952m ± 50% ~ (p=0.310 n=6)
RedisGetNil-10 6.488µ ± 69% 7.487µ ± 48% ~ (p=0.093 n=6)
RedisSetString/pool=10_value=64-10 6.739µ ± 70% 7.171µ ± 61% +6.40% (p=0.041 n=6)
RedisSetString/pool=10_value=1024-10 6.570µ ± 75% 7.370µ ± 58% +12.18% (p=0.041 n=6)
RedisSetString/pool=10_value=65536-10 15.94µ ± 12% 16.02µ ± 12% ~ (p=0.310 n=6)
RedisSetString/pool=10_value=1048576-10 115.0µ ± 7% 119.1µ ± 3% ~ (p=0.132 n=6)
RedisSetString/pool=10_value=10485760-10 1.316m ± 6% 1.325m ± 6% ~ (p=1.000 n=6)
RedisSetString/pool=100_value=64-10 18.81µ ± 22% 19.14µ ± 30% ~ (p=0.310 n=6)
RedisSetString/pool=100_value=1024-10 18.83µ ± 36% 19.18µ ± 22% ~ (p=0.143 n=6)
RedisSetString/pool=100_value=65536-10 23.59µ ± 12% 29.25µ ± 17% +23.96% (p=0.009 n=6)
RedisSetString/pool=100_value=1048576-10 152.7µ ± 8% 153.9µ ± 5% ~ (p=0.818 n=6)
RedisSetString/pool=100_value=10485760-10 1.298m ± 3% 1.311m ± 3% ~ (p=0.394 n=6)
RedisSetGetBytes-10 42.08µ ± 6% 48.57µ ± 3% +15.40% (p=0.002 n=6)
RedisMGet-10 17.92µ ± 3% 19.46µ ± 4% +8.62% (p=0.002 n=6)
SetExpire-10 35.95µ ± 2% 39.06µ ± 2% +8.65% (p=0.002 n=6)
Pipeline-10 18.51µ ± 2% 19.68µ ± 4% +6.32% (p=0.002 n=6)
ZAdd-10 17.93µ ± 3% 19.69µ ± 3% +9.81% (p=0.002 n=6)
XRead-10 39.61µ ± 2% 41.66µ ± 2% +5.16% (p=0.002 n=6)
ClusterPing-10 18.23µ ± 6% 19.92µ ± 2% +9.31% (p=0.002 n=6)
ClusterDoInt-10 17.38µ ± 9% 21.17µ ± 5% +21.79% (p=0.002 n=6)
ClusterSetString-10 19.97µ ± 3% 22.28µ ± 4% +11.59% (p=0.002 n=6)
ExecRingSetAddrsCmd-10 47.64µ ± 3% 50.64µ ± 5% +6.31% (p=0.002 n=6)
geomean 4.634µ 6.440µ +38.95%
│ 345ad759.bench.txt │ dadcdcf2.bench.txt │
│ B/op │ B/op vs base │
Decode/RespError-server-10 180.0 ± 0% 388.0 ± 0% +115.56% (p=0.002 n=6)
Decode/RespStatus-server-10 200.0 ± 0% 408.0 ± 0% +104.00% (p=0.002 n=6)
Decode/RespInt-server-10 132.0 ± 0% 340.0 ± 0% +157.58% (p=0.002 n=6)
Decode/RespString-server-10 160.0 ± 0% 367.0 ± 0% +129.38% (p=0.002 n=6)
Decode/RespArray-server-10 256.0 ± 0% 464.0 ± 0% +81.25% (p=0.002 n=6)
Decode/RespPipeline-server-10 704.0 ± 0% 928.0 ± 0% +31.82% (p=0.002 n=6)
Decode/RespTxPipeline-server-10 1.055Ki ± 0% 1.273Ki ± 0% +20.74% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=5-10 184.0 ± 1% 392.0 ± 0% +113.04% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=20-10 183.0 ± 0% 392.0 ± 0% +114.21% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=50-10 183.0 ± 0% 392.0 ± 0% +114.21% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=100-10 183.0 ± 0% 392.0 ± 0% +114.21% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=5-10 159.0 ± 0% 367.0 ± 0% +130.82% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=20-10 159.0 ± 0% 367.0 ± 0% +130.82% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=50-10 159.0 ± 0% 368.0 ± 0% +131.45% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=100-10 160.0 ± 0% 368.0 ± 0% +130.00% (p=0.002 n=6)
Decode/RespError-cluster-10 180.0 ± 0% 388.0 ± 0% +115.56% (p=0.002 n=6)
Decode/RespStatus-cluster-10 200.0 ± 0% 408.0 ± 0% +104.00% (p=0.002 n=6)
Decode/RespInt-cluster-10 132.0 ± 0% 340.0 ± 0% +157.58% (p=0.002 n=6)
Decode/RespString-cluster-10 160.0 ± 0% 368.0 ± 0% +130.00% (p=0.002 n=6)
Decode/RespArray-cluster-10 256.0 ± 0% 464.0 ± 0% +81.25% (p=0.002 n=6)
Decode/RespPipeline-cluster-10 1.344Ki ± 0% 1.547Ki ± 0% +15.12% (p=0.002 n=6)
Decode/RespTxPipeline-cluster-10 1.992Ki ± 0% 2.195Ki ± 0% +10.20% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=5-10 184.0 ± 1% 391.0 ± 0% +112.50% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=20-10 183.0 ± 0% 391.0 ± 0% +113.66% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=50-10 183.0 ± 0% 391.0 ± 0% +113.66% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=100-10 183.0 ± 0% 391.0 ± 0% +113.66% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=5-10 159.0 ± 0% 367.0 ± 0% +130.82% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=20-10 159.0 ± 0% 367.0 ± 0% +130.82% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=50-10 159.0 ± 0% 367.0 ± 0% +130.82% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=100-10 159.0 ± 0% 368.0 ± 0% +131.45% (p=0.002 n=6)
RingShardingRebalanceLocked-10 8.559Ki ± 0% 8.559Ki ± 0% ~ (p=1.000 n=6) ¹
RedisPing-10 160.0 ± 1% 368.0 ± 0% +130.00% (p=0.002 n=6)
SetGoroutines-10 284.5Ki ± 1% 487.9Ki ± 2% +71.52% (p=0.002 n=6)
RedisGetNil-10 188.0 ± 0% 396.0 ± 0% +110.64% (p=0.002 n=6)
RedisSetString/pool=10_value=64-10 256.0 ± 0% 464.0 ± 0% +81.25% (p=0.002 n=6)
RedisSetString/pool=10_value=1024-10 256.0 ± 0% 464.0 ± 0% +81.25% (p=0.002 n=6)
RedisSetString/pool=10_value=65536-10 257.0 ± 0% 465.0 ± 0% +80.93% (p=0.002 n=6)
RedisSetString/pool=10_value=1048576-10 265.0 ± 1% 474.0 ± 0% +78.87% (p=0.002 n=6)
RedisSetString/pool=10_value=10485760-10 362.0 ± 6% 578.5 ± 1% +59.81% (p=0.002 n=6)
RedisSetString/pool=100_value=64-10 257.0 ± 0% 465.0 ± 0% +80.93% (p=0.002 n=6)
RedisSetString/pool=100_value=1024-10 257.0 ± 0% 465.0 ± 0% +80.93% (p=0.002 n=6)
RedisSetString/pool=100_value=65536-10 257.0 ± 0% 466.0 ± 0% +81.32% (p=0.002 n=6)
RedisSetString/pool=100_value=1048576-10 268.5 ± 1% 476.5 ± 1% +77.47% (p=0.002 n=6)
RedisSetString/pool=100_value=10485760-10 368.0 ± 4% 579.0 ± 2% +57.34% (p=0.002 n=6)
RedisSetGetBytes-10 10.44Ki ± 0% 10.85Ki ± 0% +3.90% (p=0.002 n=6)
RedisMGet-10 305.0 ± 0% 513.0 ± 0% +68.20% (p=0.002 n=6)
SetExpire-10 446.5 ± 0% 863.0 ± 0% +93.28% (p=0.002 n=6)
Pipeline-10 539.0 ± 0% 765.0 ± 0% +41.93% (p=0.002 n=6)
ZAdd-10 281.0 ± 0% 489.0 ± 0% +74.02% (p=0.002 n=6)
XRead-10 2.133Ki ± 0% 2.539Ki ± 0% +19.05% (p=0.002 n=6)
ClusterPing-10 165.0 ± 1% 375.0 ± 0% +127.27% (p=0.002 n=6)
ClusterDoInt-10 223.0 ± 0% 432.0 ± 0% +93.72% (p=0.002 n=6)
ClusterSetString-10 259.0 ± 0% 468.0 ± 0% +80.69% (p=0.002 n=6)
ExecRingSetAddrsCmd-10 186.0 ± 0% 395.0 ± 0% +112.37% (p=0.002 n=6)
geomean 328.3 616.8 +87.89%
¹ all samples are equal
│ 345ad759.bench.txt │ dadcdcf2.bench.txt │
│ allocs/op │ allocs/op vs base │
Decode/RespError-server-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/RespStatus-server-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/RespInt-server-10 4.000 ± 0% 8.000 ± 0% +100.00% (p=0.002 n=6)
Decode/RespString-server-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/RespArray-server-10 10.00 ± 0% 14.00 ± 0% +40.00% (p=0.002 n=6)
Decode/RespPipeline-server-10 19.00 ± 0% 25.00 ± 0% +31.58% (p=0.002 n=6)
Decode/RespTxPipeline-server-10 32.00 ± 0% 38.00 ± 0% +18.75% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=5-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=20-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=50-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/DynamicGoroutine-server-pool=100-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=5-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=20-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=50-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/StaticGoroutine-server-pool=100-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/RespError-cluster-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/RespStatus-cluster-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/RespInt-cluster-10 4.000 ± 0% 8.000 ± 0% +100.00% (p=0.002 n=6)
Decode/RespString-cluster-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/RespArray-cluster-10 10.00 ± 0% 14.00 ± 0% +40.00% (p=0.002 n=6)
Decode/RespPipeline-cluster-10 31.00 ± 0% 34.00 ± 0% +9.68% (p=0.002 n=6)
Decode/RespTxPipeline-cluster-10 48.00 ± 0% 51.00 ± 0% +6.25% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=5-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=20-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=50-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/DynamicGoroutine-cluster-pool=100-10 6.000 ± 0% 10.000 ± 0% +66.67% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=5-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=20-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=50-10 5.000 ± 0% 9.000 ± 0% +80.00% (p=0.002 n=6)
Decode/StaticGoroutine-cluster-pool=100-10 5.000 ± 20% 9.000 ± 11% +80.00% (p=0.002 n=6)
RingShardingRebalanceLocked-10 7.000 ± 0% 7.000 ± 0% ~ (p=1.000 n=6) ¹
RedisPing-10 7.000 ± 0% 11.000 ± 0% +57.14% (p=0.002 n=6)
SetGoroutines-10 9.037k ± 0% 13.037k ± 0% +44.27% (p=0.002 n=6)
RedisGetNil-10 7.000 ± 0% 11.000 ± 0% +57.14% (p=0.002 n=6)
RedisSetString/pool=10_value=64-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetString/pool=10_value=1024-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetString/pool=10_value=65536-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetString/pool=10_value=1048576-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetString/pool=10_value=10485760-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetString/pool=100_value=64-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetString/pool=100_value=1024-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetString/pool=100_value=65536-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetString/pool=100_value=1048576-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetString/pool=100_value=10485760-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
RedisSetGetBytes-10 17.00 ± 0% 25.00 ± 0% +47.06% (p=0.002 n=6)
RedisMGet-10 13.00 ± 0% 17.00 ± 0% +30.77% (p=0.002 n=6)
SetExpire-10 15.00 ± 0% 23.00 ± 0% +53.33% (p=0.002 n=6)
Pipeline-10 16.00 ± 0% 22.00 ± 0% +37.50% (p=0.002 n=6)
ZAdd-10 8.000 ± 0% 12.000 ± 0% +50.00% (p=0.002 n=6)
XRead-10 60.00 ± 0% 68.00 ± 0% +13.33% (p=0.002 n=6)
ClusterPing-10 7.000 ± 0% 11.000 ± 0% +57.14% (p=0.002 n=6)
ClusterDoInt-10 12.00 ± 0% 16.00 ± 0% +33.33% (p=0.002 n=6)
ClusterSetString-10 9.000 ± 0% 13.000 ± 0% +44.44% (p=0.002 n=6)
ExecRingSetAddrsCmd-10 8.000 ± 0% 12.000 ± 0% +50.00% (p=0.002 n=6)
geomean 9.401 14.45 +53.70%
¹ all samples are equal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment