summaryrefslogtreecommitdiff
path: root/src/Names.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Names.zig')
-rw-r--r--src/Names.zig6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Names.zig b/src/Names.zig
index 0c8ba075..66f71bb9 100644
--- a/src/Names.zig
+++ b/src/Names.zig
@@ -146,8 +146,7 @@ pub fn typed(n: *Names, gpa: std.mem.Allocator, text: []const u8) void {
pub fn rescore(n: *Names, gpa: std.mem.Allocator) void {
const q = n.queryText();
const empty = std.mem.trim(u8, q, " ").len == 0;
- const io = std.Io.Threaded.global_single_threaded.io();
- const started = std.Io.Clock.awake.now(io);
+ const started = pardes.FrameStats.nowNs();
const had = n.hits.items.len;
const was_scored = n.scored;
var count: usize = 0;
@@ -164,8 +163,7 @@ pub fn rescore(n: *Names, gpa: std.mem.Allocator) void {
const s = if (empty) 0 else match(q, key, n.lower.items[c.start + c.key ..][0..c.key_len], c.base, null, null, null);
if (s) |score| n.hits.append(gpa, .{ .cand = i, .score = score }) catch break;
// The clock every 256 candidates: reading it is not free either.
- if (!empty and count % 256 == 255 and
- started.durationTo(std.Io.Clock.awake.now(io)).toNanoseconds() > score_budget_ns) break;
+ if (!empty and count % 256 == 255 and pardes.tape.over(started, score_budget_ns)) break;
}
// An empty query keeps the source's order (the walk's, recency): no
// row moves as the walk goes on, it only grows at the foot.