-
Notifications
You must be signed in to change notification settings - Fork 43
Add small precision fast-path to Quo #98
Copy link
Copy link
Closed
Description
I've been doing some benchmarks to compare APD's performance vs other approaches we're considering (cosmos/cosmos-sdk#7772).
It seems that Quo operations perform pretty poorly compare to Add, Mul, etc.:
Benchmark/1_Ops:_apd.Decimal128.Add
Benchmark/1_Ops:_apd.Decimal128.Add-16 5285344 218 ns/op
Benchmark/1_Ops:_apd.Decimal128.Sub
Benchmark/1_Ops:_apd.Decimal128.Sub-16 5665453 208 ns/op
Benchmark/1_Ops:_apd.Decimal128.Mul
Benchmark/1_Ops:_apd.Decimal128.Mul-16 9138602 138 ns/op
Benchmark/1_Ops:_apd.Decimal128.Quo
Benchmark/1_Ops:_apd.Decimal128.Quo-16 162537 7790 ns/opThis benchmark is basically just perform a single operation on two random floating point numbers (different ones each round). I'm using a Context configured with decimal128 parameters (i.e. Precision = 34, etc.)
Is Quo inherently expected to be 40x slower than other operations or could there be a performance bottleneck?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels