You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <[email protected]>
Change-Id: Idd6ac1925f5dd786313ea450218d4d17eb590581
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/549087
Reviewed-by: Daniel Martí <[email protected]>
Reviewed-by: Roger Peppe <[email protected]>
Unity-Result: CUEcueckoo <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
0 commit comments