Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: adobe/data
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: adobe/data
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: perf/managed-typed-array-class
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 4 commits
  • 5 files changed
  • 2 contributors

Commits on Apr 28, 2026

  1. perf(managed-array): convert numeric column to a class

    Convert createManagedTypedArray's anonymous-object-with-closures
    implementation into a ManagedTypedArrayColumn class. Every numeric
    column now shares one hidden class and one set of prototype methods,
    so the polymorphic IC at column.get / column.set call sites in tight
    per-row loops monomorphizes.
    
    Measurements on the perftest:
      - Focused CPU profile of ec2s:move_column run() body:
          1.26 ms/iter -> 0.23 ms/iter  (5.4x)
      - Full perftest (with framework overhead and ECS getTables):
          24 MFlops -> 31 MFlops        (~30%)
    
    All 1077 unit tests still pass; type-check clean. Behaviour is
    unchanged — same ManagedArray<number> shape, same grow / refresh /
    JSON semantics.
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    krisnye and claude committed Apr 28, 2026
    Configuration menu
    Copy the full SHA
    b35ffd7 View commit details
    Browse the repository at this point in the history
  2. perftest: warmup phase and auto-tuned N

    Two harness changes for less noisy, more comparable results:
    
    1. Warmup loop (50ms of throwaway test.run() calls) before the timed
       budget begins, so V8 has fully optimized the inner loop before any
       sample is recorded.
    
    2. Auto-tune n upward when probe time falls below the 0.5ms target
       floor. Tests that were measuring at the timer-resolution noise floor
       (e.g. SIMD wasm at 0.01ms) now run at n=1M where each iteration
       takes ~0.1-0.3ms and dominates the timer call overhead. Cap is 1M.
       Tests already in the band keep their starting n, and we never scale
       down (would change benchmark semantics).
    
    Added an "N" column to the results table so the chosen size is
    visible.
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    krisnye and claude committed Apr 28, 2026
    Configuration menu
    Copy the full SHA
    cb96ef5 View commit details
    Browse the repository at this point in the history
  3. docs(perf): add performance skill + typed-buffer perftest suite

    Adds .claude/skills/performance/SKILL.md capturing the closure->class
    refactor pattern, V8 hidden-class reasoning, accept/reject criteria,
    and the public-API discipline that keeps consumers seeing
    data-oriented interface objects regardless of implementation.
    
    Adds packages/data/src/perftest/typed-buffer-perf.ts with workloads
    for NumberTypedBuffer, ArrayTypedBuffer, and three StructTypedBuffer
    patterns (get, set, round_trip). Wires into perftest/index.ts so the
    maintainer can re-run benchmarks alongside the ECS suites.
    
    Baseline numbers (Chromium headless, after harness improvements):
    
      number_get_set       N=100k  0.19ms  393 MFlops
      array_get            N=100k  0.20ms  375 MFlops
      struct_get           N=1M   10.90ms   69 MFlops
      struct_set           N=100k  0.73ms  102 MFlops
      struct_round_trip    N=100k  1.95ms   38 MFlops
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    krisnye and claude committed Apr 28, 2026
    Configuration menu
    Copy the full SHA
    9e6d2cc View commit details
    Browse the repository at this point in the history
  4. docs(perf): record measured negative result for struct readout class

    Tried generating a class for flat-object struct readout in
    create-read-struct.ts. Benched N=1M Vec3 read sweep:
      before:  10.90 ms / 69 MFlops
      after:   10.60 ms / 71 MFlops  (-2.8%)
    
    Round-trip and set were unchanged. Below the 25%/15% thresholds in the
    plan, so the implementation was reverted. Updated the SKILL with the
    specific number so future readers don't re-try the same experiment;
    the real cure for per-element allocation is a surface change (bulk
    APIs, getInto), not class-ifying the readout — V8 already lands on a
    stable hidden class for object literals with fixed-order property
    init.
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    krisnye and claude committed Apr 28, 2026
    Configuration menu
    Copy the full SHA
    c215bb5 View commit details
    Browse the repository at this point in the history
Loading