Skip to content

refactor: use b.Loop() to simplify the code and improve performance#374

Open
cargoedit wants to merge 1 commit into
xssnick:masterfrom
cargoedit:master
Open

refactor: use b.Loop() to simplify the code and improve performance#374
cargoedit wants to merge 1 commit into
xssnick:masterfrom
cargoedit:master

Conversation

@cargoedit
Copy link
Copy Markdown

replace for i := range b.N or for range b.N in a benchmark with for b.Loop(), and remove any preceding calls to b.StopTimer, b.StartTimer, and b.ResetTimer.

Supported by Go Team, more info: https://go.dev/blog/testing-b-loop

Signed-off-by: cargoedit <cargoedit@outlook.com>
@cargoedit
Copy link
Copy Markdown
Author

@xssnick Hi, Could you please review this PR at your convenience? Thank you very much.

@purelualight
Copy link
Copy Markdown

@xssnick Hi, Could you please review this PR at your convenience? Thank you very much.

I made the same observation, but I saw that it has already been submitted.
Good fixes. @cargoedit @xssnick

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