perf(性能提升): 优化字体并发与复杂页渲染

This commit is contained in:
xiaoqidun committed 2026-10-26 14:42:35 +08:00
1 parent 15a532a1ca
commit 04d7d2d672
3 files changed
+53 -21

No files matched your search

+2
View File
@@ -337,9 +337,11 @@ async function handleMessage(engine, { id, name, args }) {
if (!saving && args.some(value => value?.mode !== undefined)) args.push(done => finish(done));
}
}
const started = name === "ofdgoOpen" || name === "ofdgoRenderPage" ? performance.now() : null;
const payload = await globalThis.ofdgoEngineCall(engine.id, name, ...args);
signal?.throwIfAborted();
const result = typeof payload === "string" ? JSON.parse(payload) : payload;
if (started !== null && result.ok) result.elapsed = performance.now() - started;
if (cancellable && !importing && !converting && !resources && result.ok) {
result.data.size = size;
if (name !== "ofdgoExportMedia") postMessage({ id, type: "export", stage: "save" });