Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roman/price refactor #104

Merged
merged 7 commits into from
Mar 14, 2024
Merged

Roman/price refactor #104

merged 7 commits into from
Mar 14, 2024

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Mar 13, 2024

Benchmarks

Pricing Logic

There isn't a meaningful change in performance

~/go/bin/benchstat old2 new2
goos: linux
goarch: amd64
pkg: github.com/osmosis-labs/sqs/tokens/usecase
cpu: Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz
            │     old2     │             new2              │
            │    sec/op    │   sec/op     vs base          │
GetPrices-8   7.377m ± 27%   7.443m ± 3%  ~ (p=0.853 n=10)

            │     old2     │                new2                 │
            │     B/op     │     B/op      vs base               │
GetPrices-8   9.942Mi ± 0%   9.923Mi ± 0%  -0.20% (p=0.000 n=10)

            │    old2     │                new2                │
            │  allocs/op  │  allocs/op   vs base               │
GetPrices-8   138.2k ± 0%   137.8k ± 0%  -0.28% (p=0.000 n=10)

Precompute Logic

Precompute

goos: linux
goarch: amd64
pkg: github.com/osmosis-labs/sqs/router/usecase
cpu: Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz
BenchmarkGetPrecomputeOrderOfMagnitude-8   	 3527824	       371.8 ns/op	      96 B/op	       6 allocs/op
BenchmarkGetPrecomputeOrderOfMagnitude-8   	 3109318	       328.9 ns/op	      96 B/op	       6 allocs/op
BenchmarkGetPrecomputeOrderOfMagnitude-8   	 3569872	       349.1 ns/op	      96 B/op	       6 allocs/op
BenchmarkGetPrecomputeOrderOfMagnitude-8   	 3276049	       352.9 ns/op	      96 B/op	       6 allocs/op
BenchmarkGetPrecomputeOrderOfMagnitude-8   	 3739591	       322.9 ns/op	      96 B/op	       6 allocs/op
BenchmarkGetPrecomputeOrderOfMagnitude-8   	 3297483	       324.7 ns/op	      96 B/op	       6 allocs/op
PASS
ok  	github.com/osmosis-labs/sqs/router/usecase	10.494s

Non-precompute

goos: linux
goarch: amd64
pkg: github.com/osmosis-labs/sqs/router/usecase
cpu: Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz
BenchmarkOrderOfMagnitude-8   	  229332	      5374 ns/op	    1256 B/op	      22 allocs/op
BenchmarkOrderOfMagnitude-8   	  239371	      5549 ns/op	    1256 B/op	      22 allocs/op
BenchmarkOrderOfMagnitude-8   	  257167	      5405 ns/op	    1256 B/op	      22 allocs/op
BenchmarkOrderOfMagnitude-8   	  236186	      4932 ns/op	    1256 B/op	      22 allocs/op
BenchmarkOrderOfMagnitude-8   	  233816	      5151 ns/op	    1256 B/op	      22 allocs/op
BenchmarkOrderOfMagnitude-8   	  222508	      8797 ns/op	    1256 B/op	      22 allocs/op
PASS
ok  	github.com/osmosis-labs/sqs/router/usecase	12.149s

@p0mvn p0mvn force-pushed the roman/price-refactor branch 8 times, most recently from ccb096f to f3b6be3 Compare March 14, 2024 05:44
@p0mvn p0mvn merged commit 39f385e into v23.x Mar 14, 2024
5 checks passed
@p0mvn p0mvn deleted the roman/price-refactor branch March 14, 2024 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant