-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(namespace): speed up Namespace comparisons (#63)
While reading and checking structures from celestiaorg.github.io/celestia-app/specs/data_structures.html I noticed that we compare namespaces not optimal enough. Every equal or compare-like operation allocates new slice with data that can be already compared directly. ``` % go-perftuner bstat a.txt b.txt args: [a.txt b.txt]name old time/op new time/op delta Equal-10 71.9ns ± 0% 3.9ns ± 0% -94.53% (p=0.008 n=5+5) Compare-10 72.0ns ± 1% 4.4ns ± 5% -93.83% (p=0.002 n=6+6) name old alloc/op new alloc/op delta Equal-10 64.0B ± 0% 0.0B -100.00% (p=0.026 n=5+6) Compare-10 64.0B ± 0% 0.0B -100.00% (p=0.002 n=6+6) name old allocs/op new allocs/op delta Equal-10 2.00 ± 0% 0.00 -100.00% (p=0.026 n=5+6) Compare-10 2.00 ± 0% 0.00 -100.00% (p=0.002 n=6+6) ```
- Loading branch information
1 parent
e4e8a8b
commit c6540fc
Showing
2 changed files
with
140 additions
and
10 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