-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid allocations by not calling custom functions on hot path (#1289)
This is absolutely wild 🙃 **Before** ``` BenchmarkRegalLintingItself-10 1 3245668375 ns/op 6689411656 B/op 127195706 allocs/op ``` **After** ``` BenchmarkRegalLintingItself-10 1 2777580459 ns/op 5235852824 B/op 107686435 allocs/op ``` And ``` hyperfine -i --warmup 1 'regal lint bundle' 'regal-new lint bundle' Benchmark 1: regal lint bundle Time (mean ± σ): 3.232 s ± 0.046 s [User: 22.535 s, System: 0.623 s] Range (min … max): 3.169 s … 3.296 s 10 runs Benchmark 2: regal-new lint bundle Time (mean ± σ): 2.754 s ± 0.046 s [User: 18.641 s, System: 0.472 s] Range (min … max): 2.689 s … 2.813 s 10 runs Summary regal-new lint bundle ran 1.17 ± 0.03 times faster than regal lint bundle ``` No @srenatus, I will not use benchstat! 🤣 Signed-off-by: Anders Eknert <[email protected]>
- Loading branch information
1 parent
8759f08
commit 0db5b5f
Showing
3 changed files
with
62 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters