Skip to content

Native editor 2.13: standalone typing and undo latency with synthetic reproduction #4002

Description

@winstonsmith17

Native editor: noticeable input/undo latency in standalone local mode

We are seeing perceptible typing and especially undo delay with SuperDoc's native
editor. This reproduces without our application, save callbacks, remote storage,
or a remote collaboration service. Upgrading 2.12.0 to 2.13.0 did not resolve it.

Here is a standalone runnable reproduction with an entirely synthetic DOCX,
pinned dependencies, generator and in-browser timing instrumentation. No customer
data is included. See README.md for steps and measurement limitations.

On the included 23-page synthetic fixture, 2.13.0 / engine 0.12.0 measured 34 ms
median typing across 12 keys and 277 ms for one undo. A separate private 27-page
file measured 94 ms median typing and 298 ms undo in local mode; that file is not
attached. The synthetic case reproduces undo latency, but not all typing latency.
Disabling the toolbar, reducing the virtual page window, and using continuous web
layout did not provide a useful improvement in the private-file controls.

Could you profile the native undo-to-render pipeline against this fixture and
identify a supported fix or runtime patch? In the synthetic trace, undo is
followed by overlapping captureReviewSource, tables and review-index work before
DOM updates; in the private-file trace, historyUndo itself took 260 ms. We do not
have evidence to assign the exact cause to one internal function.

Is there a supported path to present local text/caret/undo changes immediately
while document reconciliation and review/layout work complete asynchronously?
We need to keep native selection, IME, undo and collaboration semantics intact.
Our desired result is responsive local editing independent of save latency.

We would like to help implement and validate a fix. Is there a supported native
engine profiling build, source-access path, or patch mechanism we can use?
We can compare candidate builds against this reproduction before integration.

Reproduction steps

git clone https://gist.github.com/dfb4377967ae23c3fc46ee7df09edc25.git superdoc-latency
cd superdoc-latency
npm install --ignore-scripts
python3 make-latency-fixture.py synthetic.docx --image
npm start

Open http://127.0.0.1:4319/?mode=local&trace=1 in a visible foreground tab.
Wait for local ready, place the caret at the end of Latency sample, type
xyzabcdefghi one key at a time, then Cmd+Z / Ctrl+Z. The timing report appears
above the editor. See the README for controls and limitations.

Measured in foreground Chromium through Codex on macOS, without CPU throttling.
Timing starts inside the browser at keydown; automation transport is excluded.
These are small samples; paint opportunity is not a hardware paint timestamp.

Related: #3842, although that report concerns a different fixture and pipeline.
This report specifically tests the current 2.13.0 native runtime / engine 0.12.0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: queuedEngineering work is queued; no delivery date is committed.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions