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

⚡ Optimize App.buildTree() #1809

Merged
merged 2 commits into from Mar 7, 2022
Merged

⚡ Optimize App.buildTree() #1809

merged 2 commits into from Mar 7, 2022

Conversation

jfcg
Copy link
Contributor

@jfcg jfcg commented Mar 5, 2022

  • Reduces reads from / writes to slices
  • Reduces reads from maps
  • Increases sorting speed

- Reduces reads from / writes to slices
- Reduces reads from maps
- Increases sorting speed
@ReneWerner87
Copy link
Member

@jfcg hi, can you post a benchmark report here of the times before and after ?

@jfcg
Copy link
Contributor Author

jfcg commented Mar 7, 2022

Hi @ReneWerner87,
Added Benchmark_Startup_Process(). When run with

go test -run=^$ -bench=Benchmark_Startup_Process -benchmem -count=9

It gets 1427122 ns/op (median) and 1406289 ns/op (mean) on this branch.
It gets 1509394 ns/op (median) and 1521415 ns/op (mean) on master.

Diff is 82.3 µs/op (median) and 115.1 µs/op (mean) 😃

Cheers..

Note: My CPU is Core i5 4210M

@ReneWerner87 ReneWerner87 merged commit 870f942 into gofiber:master Mar 7, 2022
@jfcg jfcg deleted the optimize-app-buildTree branch March 7, 2022 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants