Skip to content

Conversation

@promalert
Copy link

@promalert promalert commented Oct 29, 2025

Before asking for reviews, here is a check list of the most common things you might need to consider:

  • updating the Changelog
  • writing unit tests
  • checking if your changes affect other coins or tokens in unintended ways
  • testing on multiple environments (Qt, Android, ...)
  • having an AI review your changes

These changes use b.Loop() to simplify the code and improve performance
Supported by Go Team, more info: https://go.dev/blog/testing-b-loop 

Before:

go test -run=^$ -bench=. ./backend/rates     
goos: darwin
goarch: arm64
pkg: github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates
cpu: Apple M4
BenchmarkBoltDump/individual-10  	     108	  10673439 ns/op
BenchmarkBoltDump/json-10        	     102	  12105460 ns/op
BenchmarkBoltDump/gob-10         	     115	   9884914 ns/op
BenchmarkBoltLoad/individual-10  	   15694	     73471 ns/op
BenchmarkBoltLoad/json-10        	     748	   1925352 ns/op
BenchmarkBoltLoad/gob-10         	    5659	    202964 ns/op
Logging into '/Users/mac/Library/Application Support/bitbox/log.txt' from 'debug'.
BenchmarkDumpHistoryBucket-10    	      92	  11816275 ns/op
BenchmarkLoadHistoryBucket-10    	   15392	     76318 ns/op
PASS
ok  	github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates	14.947s

After:

 go test -run=^$ -bench=. ./backend/rates             
goos: darwin
goarch: arm64
pkg: github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates
cpu: Apple M4
BenchmarkBoltDump/individual-10  	     110	  11288706 ns/op
BenchmarkBoltDump/json-10        	     106	  11686261 ns/op
BenchmarkBoltDump/gob-10         	     116	  10437647 ns/op
BenchmarkBoltLoad/individual-10  	   16374	     73399 ns/op
BenchmarkBoltLoad/json-10        	     762	   1553812 ns/op
BenchmarkBoltLoad/gob-10         	    5810	    204027 ns/op
Logging into '/Users/mac/Library/Application Support/bitbox/log.txt' from 'debug'.
BenchmarkDumpHistoryBucket-10    	     110	  10907391 ns/op
BenchmarkLoadHistoryBucket-10    	   15259	     76367 ns/op
PASS
ok  	github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates	13.338s

@promalert
Copy link
Author

@benma Thanks! If there's anything need I to do, please feel free to let me know.

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.

2 participants