rocicorp / repc

The canonical Replicache client, implemented in Rust.
Other
31 stars 7 forks source link

Switch from optimizing for space to speed. #198

Closed aboodman closed 3 years ago

aboodman commented 3 years ago

This increases scan performance on our benchmarks about 7%.

Summary of tradeoffs from my testing:

opt-level size Δsize scan Δscan put clean Δput clean put dirty Δput dirty
z 143085 0.00% 16.55 0.00% 2.02 0.00% 1.74 0.00%
3 160698 12.31% 17.69 6.89% 2.50 23.76% 2.88 65.52%
2 158405 10.71% 17.44 5.38% 2.36 16.83% 2.77 59.20%
1 167348 16.96% 8.03 -51.48% 0.79 -60.89% 0.55 -68.39%

Unclear how put-dirty somehow gets faster than put-clean under optimization.

phritz commented 3 years ago

Wait, are the levels enumerated correctly in your table? Am I reading it right that 1 looks the best (or should that be 3)?

aboodman commented 3 years ago

The units are MB/s so bigger is better. 1 somehow managed to be terrible at everything, far slower than even “optimize for size”