perf: audit EmbeddingGemma 2 and reuse measured query embeddings
Core CI / core (ubuntu-latest) (push) Failing after 3m43s
Core CI / core (macos-latest) (push) Canceled after 0s
Core CI / core (windows-latest) (push) Canceled after 0s
Core CI / desktop (ubuntu-latest) (push) Successful in 5m56s
Core CI / desktop (macos-latest) (push) Canceled after 0s
Core CI / desktop (windows-latest) (push) Canceled after 0s

This commit is contained in:
karl committed 2026-10-12 20:59:10 +02:00
1 parent 9870df7cb5
commit 8b9b079469
21 files changed
+4119 -129

No files matched your search

+5 -8
View File
@@ -11,6 +11,8 @@ import {
AutomaticIndexGate,
emptySearchState,
LatestLane,
semanticAvailable,
SEMANTIC_SETTLE_MS,
} from "./search-state";
import type { SemanticPhase } from "./search-state";
import { fileIcon, icon } from "./icons";
@@ -272,12 +274,7 @@ function refreshEmptySearchState() {
}
function canSearchSemantically() {
return Boolean(
semanticStatus?.ready &&
semanticStatus.generation !== null &&
!semanticStatus.embedding &&
!semanticJobActive,
);
return semanticAvailable(semanticStatus);
}
function queueSemanticRefresh(delay = 1000) {
@@ -954,7 +951,7 @@ function refreshPerformance(request: SearchRequest) {
);
for (const [lane, delay] of Object.entries(report.lane_schedule_ms))
append(
`${lane}: scheduled ${delay.toFixed(1)} ms after debounce${lane === "hybrid" ? " (includes intentional 350 ms semantic delay or waiting for readiness)" : ""}`,
`${lane}: scheduled ${delay.toFixed(1)} ms after debounce${lane === "hybrid" ? ` (includes intentional ${SEMANTIC_SETTLE_MS} ms semantic delay or waiting for readiness)` : ""}`,
);
for (const attempt of report.attempts) {
append(
@@ -1123,7 +1120,7 @@ async function search(inputAt = performance.now()) {
hybridTimer = setTimeout(() => {
if (isCurrent(request) && canSearchSemantically())
submitSearch(request, "hybrid");
}, 350);
}, SEMANTIC_SETTLE_MS);
} catch (error) {
showError(error);
}
+11
View File
@@ -1,3 +1,14 @@
/** Let rapid typing settle before starting the model lane. */
export const SEMANTIC_SETTLE_MS = 120;
/** A rebuild retains the previous committed generation. Backend readiness is
* withdrawn only while a replacement query graph is being prepared. */
export function semanticAvailable(
status: { ready: boolean; generation: number | null } | null,
) {
return Boolean(status?.ready && status.generation !== null);
}
/** One active request per lane; intermediate keystrokes collapse to the latest.
* Native work already running cannot be cancelled, so revisions guard every
* result and retry. Busy responses receive at most one delayed retry. */