forked from gohugoio/hugo
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hugolib: Compare every element in pages cache
It is slightly slower, but correctnes is, of course, more important: ```bash benchmark old ns/op new ns/op delta BenchmarkSortByWeightAndReverse-4 367 645 +75.75% benchmark old allocs new allocs delta BenchmarkSortByWeightAndReverse-4 2 2 +0.00% benchmark old bytes new bytes delta BenchmarkSortByWeightAndReverse-4 64 64 +0.00% ``` Running the same benchmark without any cache (i.e. resorting the slice on every iteration) and then compare it to the current version shows that it still is plenty worth it: ```bash ▶ benchcmp 2.bench 1.bench benchmark old ns/op new ns/op delta BenchmarkSortByWeightAndReverse-4 1358757 645 -99.95% benchmark old allocs new allocs delta BenchmarkSortByWeightAndReverse-4 17159 2 -99.99% benchmark old bytes new bytes delta BenchmarkSortByWeightAndReverse-4 274573 64 -99.98% ``` Closes gohugoio#5239
- Loading branch information
Showing
4 changed files
with
8 additions
and
16 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
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