Skip to content

Commit fbf7528

Browse files
author
Tomasz bla Fortuna
committed
Make results more stable by including phrase in sorting.
Pre-heat cache: DID 4017 on 1 threads in 4.944, 812.51/s (812.5 per thread), 1.2308ms/q (4014/4017) Cache Cities/Streets {'hits': 1100, 'misses': 2917, 'inserts': 2917, 'size': 2000} {'hits': 1369, 'misses': 1305, 'inserts': 1305, 'size': 1305} OK: DID 4017 on 1 threads in 4.328, 928.24/s (928.2 per thread), 1.0773ms/q (4014/4017) DID 4017 on 4 threads in 1.501, 2677.06/s (669.3 per thread), 0.3735ms/q (4014/4017) DID 4017 on 8 threads in 1.039, 3867.01/s (483.4 per thread), 0.2586ms/q (4014/4017) DID 4017 on 12 threads in 0.930, 4321.07/s (360.1 per thread), 0.2314ms/q (4014/4017) DID 4017 on 16 threads in 0.894, 4493.22/s (280.8 per thread), 0.2226ms/q (4014/4017) (All recent tests on AMD Ryzen 7 3800X 8-Core, 32GB RAM)
1 parent 2fd69ff commit fbf7528

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fuzzdex/seeker.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ impl Index {
246246
}
247247

248248
results.sort_unstable_by(|a, b| {
249-
let side_a = (a.distance, -a.score, -a.should_score, a.origin.len());
250-
let side_b = (b.distance, -b.score, -b.should_score, b.origin.len());
249+
let side_a = (a.distance, -a.score, -a.should_score, a.origin.len(), &a.origin);
250+
let side_b = (b.distance, -b.score, -b.should_score, b.origin.len(), &b.origin);
251251
side_a.partial_cmp(&side_b).unwrap_or(Ordering::Equal)
252252
});
253253

0 commit comments

Comments
 (0)