Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ This is a **Platform.Bible extension** for interlinear Bible text alignment. Pla

[src/interlinearizer.web-view.tsx](src/interlinearizer.web-view.tsx) — entry point rendered inside Platform.Bible's WebView iframe; delegates to [InterlinearizerLoader](src/components/InterlinearizerLoader.tsx) when a `projectId` is present. `useWebViewScrollGroupScrRef` and `useWebViewState` are **props injected by the PAPI host** (not hook imports).

[InterlinearizerLoader](src/components/InterlinearizerLoader.tsx) — real top of the React tree: owns modal state, persists the active interlinear project, fetches the tokenized book, and routes top-menu commands to the appropriate modal.
[InterlinearizerLoader](src/components/InterlinearizerLoader.tsx) — real top of the React tree: owns modal state, persists the active interlinear project, fetches the tokenized book and its segment pages, and routes top-menu commands to the appropriate modal.

[Interlinearizer](src/components/Interlinearizer.tsx) — renders the interlinear view from the loaded book data.

Expand Down
20 changes: 17 additions & 3 deletions e2e-tests/tests/perf/app-perf.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ async function deleteLeftoverProjects(page: Page, projectId: string): Promise<vo
}

/**
* Opens a fresh view on `book` and adds its load, the host's draft and book fetches included, to
* `open`.
* Opens a fresh view on `book` and adds its load, the host's draft, book, outline and page fetches
* included, to `open`.
*/
async function measureOpen(
page: Page,
Expand All @@ -165,6 +165,11 @@ async function measureOpen(
const hostEntries = await takeHostEntries(page);
open.addHostCall(HOST_CALLS.getDraft, hostEntries, settled);
open.addHostCall(HOST_CALLS.getTokenizedBook, hostEntries, settled);
open.addHostCall(HOST_CALLS.getBookOutline, hostEntries, settled);
// The first pages load side by side, so each is sampled without a transport to pair it with.
hostEntries
.filter(({ name }) => name === 'getSegments')
.forEach(({ duration }) => open.host.addValue('page-fetch', duration));
const tokenizes = hostEntries.filter(({ name }) => name === 'getTokenizedBook:tokenize').length;
if (tokenizes !== 1) console.warn(`Opening ${book} tokenized it ${tokenizes} times, not once`);
await closeView(page);
Expand Down Expand Up @@ -272,7 +277,16 @@ async function measureTier(
switchBook.add(
// eslint-disable-next-line no-await-in-loop
await waitForMeasure(frame, 'reanchor', tier.viewBook),
['book-fetch', 'book-parse', 'reanchor', 'book-render'],
[
'book-fetch',
'book-parse',
'outline-fetch',
'outline-parse',
'page-fetch',
'page-parse',
'reanchor',
'book-render',
],
);
}
result.switchBook = switchBook.summary();
Expand Down
5 changes: 5 additions & 0 deletions e2e-tests/tests/perf/view-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export const HOST_CALLS = {
command: 'getTokenizedBook',
phasePrefixes: ['getTokenizedBook'],
},
getBookOutline: {
measure: 'outline-fetch',
command: 'getBookOutline',
phasePrefixes: ['getBookOutline'],
},
saveDraft: { measure: 'autosave', command: 'saveDraft', phasePrefixes: ['saveDraft'] },
getProjectsForSource: {
measure: 'projects-fetch',
Expand Down
5 changes: 5 additions & 0 deletions perf/summary/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ const METRIC_LABELS: Record<string, string> = {
tokenize: 'Tokenize book',
'book-fetch': 'Fetch tokenized book',
'book-parse': 'Parse tokenized book',
'outline-fetch': 'Fetch book outline',
'outline-parse': 'Parse book outline',
'page-fetch': 'Fetch a page of segments',
'page-parse': 'Parse a page of segments',
'book-render': 'Book change to rendered',
'draft-fetch': 'Fetch draft',
'draft-parse': 'Parse draft',
Expand Down Expand Up @@ -122,6 +126,7 @@ const PHASE_LABELS: Record<string, string> = {
read: 'read storage',
usj: 'fetch USJ',
tokenize: 'extract and tokenize',
resegment: 'segment by boundaries',
parse: 'parse and validate',
compare: 'split and compare shards',
serialize: 'serialize reply',
Expand Down
Loading
Loading