-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The reimplemenation replaces uses the high-level API usage with using the low-level, making use of the fact that each Vertex used for comparison uses the same outline and the same conjuncts for "less". This significantly reduces the number of allocations and other redundant work. Before: Benchmark/sort.txtar-12 5 202090158 ns/op After: Benchmark/sort.txtar-12 28 43326277 ns/op Which is about an 80% reduction in running time. It is possible to reduce runtime further if the type indicated for x and y are idempotent. There are several strategies to analyze this. A TODO has been added for this. This change achieves the lion share of possible performance improvements for Sort. We leave it open, though, to verify the result with the various stakeholders. Issue #745 Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com> Change-Id: Idd6ac1925f5dd786313ea450218d4d17eb590581 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/549087 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Roger Peppe <rogpeppe@gmail.com> Unity-Result: CUEcueckoo <cueckoo@cuelang.org> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information
Showing
2 changed files
with
98 additions
and
9 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