Skip to content

withStampedParaId is O(N²) for bulk authoring — per-insert full-tree paragraph scan #88

Description

@kiki830621

Problem

withStampedParaId#85)每次 append/insert 都 getAllParagraphs() 全樹遞迴 + 重建 Set + 新建 generator。批次 authoring(insertBulletListinsertNumberedList 等高階 API 每 item 一呼叫)呈 O(N²)。正確性不受影響;現行 benchmark(reducer apply 路徑)未覆蓋此 chokepoint。

Type

performance

Source

Verify #85 R1 finding 4(regression lens):#85 (comment)

Expected

攤銷式唯一性檢查(如 document 級 cached ID set 隨 mutation 維護),或 bulk API 一次掃描多次配發。

Refs #85

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions