@vue-skuilder/db 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{contentSource-Ht3N2f-y.d.ts → contentSource-Cplhv3bJ.d.ts} +1 -1
- package/dist/{contentSource-BMlMwSiG.d.cts → contentSource-kI9_jwTu.d.cts} +1 -1
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +76 -21
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +76 -21
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-BEqB8VBR.d.cts → dataLayerProvider-CiA2Rr0v.d.cts} +1 -1
- package/dist/{dataLayerProvider-DObSXjnf.d.ts → dataLayerProvider-DrBqOUa3.d.ts} +1 -1
- package/dist/impl/couch/index.d.cts +35 -3
- package/dist/impl/couch/index.d.ts +35 -3
- package/dist/impl/couch/index.js +76 -21
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +76 -21
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +4 -4
- package/dist/impl/static/index.d.ts +4 -4
- package/dist/impl/static/index.js +4 -5
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +4 -5
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/{index-BWvO-_rJ.d.ts → index-BLLT5BYE.d.ts} +1 -1
- package/dist/{index-Ba7hYbHj.d.cts → index-k9NFHpS1.d.cts} +1 -1
- package/dist/index.d.cts +164 -10
- package/dist/index.d.ts +164 -10
- package/dist/index.js +215 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +215 -28
- package/dist/index.mjs.map +1 -1
- package/dist/{types-W8n-B6HG.d.cts → types-BFUa1pa3.d.cts} +1 -1
- package/dist/{types-CJrLM1Ew.d.ts → types-CHgpWQAY.d.ts} +1 -1
- package/dist/{types-legacy-JXDxinpU.d.cts → types-legacy-4tlwHnXo.d.cts} +1 -1
- package/dist/{types-legacy-JXDxinpU.d.ts → types-legacy-4tlwHnXo.d.ts} +1 -1
- package/dist/util/packer/index.d.cts +3 -3
- package/dist/util/packer/index.d.ts +3 -3
- package/docs/session-lifecycle-and-replan.md +418 -0
- package/package.json +3 -3
- package/src/core/navigators/Pipeline.ts +5 -1
- package/src/core/navigators/generators/elo.ts +19 -6
- package/src/core/navigators/generators/srs.ts +10 -0
- package/src/impl/couch/courseDB.ts +146 -17
- package/src/study/SessionController.ts +295 -13
- package/src/study/services/CardHydrationService.ts +24 -0
|
@@ -163,6 +163,9 @@ export class CardHydrationService<TView = unknown> {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
this.hydrationInProgress = true;
|
|
166
|
+
// [perf] parked 2026-05 (pipeline-docs-workup) — batch hydration timing
|
|
167
|
+
// const tFill0 = performance.now();
|
|
168
|
+
// let hydratedThisBatch = 0;
|
|
166
169
|
|
|
167
170
|
try {
|
|
168
171
|
const itemsToHydrate = this.getItemsToHydrate();
|
|
@@ -175,12 +178,20 @@ export class CardHydrationService<TView = unknown> {
|
|
|
175
178
|
|
|
176
179
|
try {
|
|
177
180
|
await this.hydrateCard(item);
|
|
181
|
+
// hydratedThisBatch++; // [perf] parked
|
|
178
182
|
} catch (e) {
|
|
179
183
|
logger.error(`[CardHydrationService] Error hydrating card ${item.cardID}:`, e);
|
|
180
184
|
}
|
|
181
185
|
}
|
|
182
186
|
} finally {
|
|
183
187
|
this.hydrationInProgress = false;
|
|
188
|
+
// [perf] parked: batch hydration timing
|
|
189
|
+
// if (hydratedThisBatch > 0) {
|
|
190
|
+
// logger.info(
|
|
191
|
+
// `[perf][Hydrate] batch: hydrated ${hydratedThisBatch} card(s) in ` +
|
|
192
|
+
// `${(performance.now() - tFill0).toFixed(0)}ms`
|
|
193
|
+
// );
|
|
194
|
+
// }
|
|
184
195
|
}
|
|
185
196
|
}
|
|
186
197
|
|
|
@@ -195,11 +206,13 @@ export class CardHydrationService<TView = unknown> {
|
|
|
195
206
|
this.hydrationInFlight.add(item.cardID);
|
|
196
207
|
|
|
197
208
|
try {
|
|
209
|
+
// const tH0 = performance.now(); // [perf] parked
|
|
198
210
|
const courseDB = this.getCourseDB(item.courseID);
|
|
199
211
|
const [cardData, tagsByCard] = await Promise.all([
|
|
200
212
|
courseDB.getCourseDoc<CardData>(item.cardID),
|
|
201
213
|
courseDB.getAppliedTagsBatch([item.cardID]),
|
|
202
214
|
]);
|
|
215
|
+
// const tFetch = performance.now(); // [perf] parked
|
|
203
216
|
|
|
204
217
|
if (!isCourseElo(cardData.elo)) {
|
|
205
218
|
cardData.elo = toCourseElo(cardData.elo);
|
|
@@ -214,6 +227,7 @@ export class CardHydrationService<TView = unknown> {
|
|
|
214
227
|
})
|
|
215
228
|
)
|
|
216
229
|
);
|
|
230
|
+
// const tDocs = performance.now(); // [perf] parked
|
|
217
231
|
|
|
218
232
|
// Extract audio URLs from all data fields and prefetch them
|
|
219
233
|
const audioToPrefetch: string[] = [];
|
|
@@ -224,6 +238,7 @@ export class CardHydrationService<TView = unknown> {
|
|
|
224
238
|
});
|
|
225
239
|
|
|
226
240
|
// Dedupe and prefetch, waiting for browser cache to be ready
|
|
241
|
+
// const tAudioStart = performance.now(); // [perf] parked
|
|
227
242
|
const uniqueAudioUrls = [...new Set(audioToPrefetch)];
|
|
228
243
|
if (uniqueAudioUrls.length > 0) {
|
|
229
244
|
logger.debug(
|
|
@@ -231,6 +246,7 @@ export class CardHydrationService<TView = unknown> {
|
|
|
231
246
|
);
|
|
232
247
|
await Promise.allSettled(uniqueAudioUrls.map(prefetchAudio));
|
|
233
248
|
}
|
|
249
|
+
// const tAudio = performance.now(); // [perf] parked
|
|
234
250
|
|
|
235
251
|
const data = dataDocs.map(displayableDataToViewData).reverse();
|
|
236
252
|
|
|
@@ -241,6 +257,14 @@ export class CardHydrationService<TView = unknown> {
|
|
|
241
257
|
tags: tagsByCard.get(item.cardID) ?? [],
|
|
242
258
|
});
|
|
243
259
|
|
|
260
|
+
// [perf] parked: per-card hydration timing (cardDoc+tags / dataDocs / audio)
|
|
261
|
+
// logger.info(
|
|
262
|
+
// `[perf][Hydrate] ${item.cardID}: ` +
|
|
263
|
+
// `cardDoc+tags=${(tFetch - tH0).toFixed(0)}ms ` +
|
|
264
|
+
// `dataDocs=${(tDocs - tFetch).toFixed(0)}ms ` +
|
|
265
|
+
// `audioPrefetch=${(tAudio - tAudioStart).toFixed(0)}ms(${uniqueAudioUrls.length} files) ` +
|
|
266
|
+
// `total=${(tAudio - tH0).toFixed(0)}ms`
|
|
267
|
+
// );
|
|
244
268
|
logger.debug(`[CardHydrationService] Hydrated card ${item.cardID}`);
|
|
245
269
|
} finally {
|
|
246
270
|
this.hydrationInFlight.delete(item.cardID);
|