Skip to content

perf: batch lazy builtin property installation during Context initialization #10

Description

@Eric-Song-Nop

Problem / 问题

Context creation still takes about 2.27 ms after release cleanup optimization (PR #4). The retest records 778 layout replacements and 943 shape lookups per Context; layout replacement accounts for about 62.6% of sampled CPU periods within Context creation. Lazy builtin-property installation repeatedly copies and replaces progressively larger layouts.

Context 初始化逐项登记内建懒属性,反复复制布局、查询 shape 并销毁中间布局。优化目标是批量安装合适的方法表,保留现有懒初始化与所有权机制。

Implementation scope / 实现范围

Add an internal batch entry that validates a table, retains key roots, copies the existing layout once, appends descriptors in order and calls existing replace_layout once. Pilot a Date table without intermediate read dependencies; expand suitable Array/TypedArray tables only after validation. Preserve Date toUTCString/toGMTString alias identity and explicit materialization boundaries, property flags/order/name/length, realm ownership and cleanup.

不重写 Heap 所有权架构,不加入少量引用保留快路径。复用现有布局和引用管理,核对准备失败与发布后错误的契约。

Stack and validation / 分支与验证

Based on personal PR #4: Eric-Song-Nop#4, branch perf/release-cleanup-fast-path at 8eb2a1e. Implementation PR targets that branch in Eric-Song-Nop/quickjs-oxide. Issues remain upstream because the personal fork has Issues disabled.

Separately measure baseline, Date pilot and expanded tables. Cover lifecycle/single startup, the existing full V8-v7 suite and microbench matrix, representative phase timing, CPU samples and diagnostics. Preserve timeout/failure/regression evidence and avoid extrapolating Richards to all workloads. Run Rust tests, strict production Clippy, full Test262 before/after comparison and binary-boundary canaries without updating frozen baselines. All heavy work runs serially on Herdr/PocketLab. Deliver bilingual report and raw evidence.

Activity

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

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