Skip to content

Profile and reduce fresh-runtime TypeScript compiler latency (GOL-347) - #134

Draft
noise64 wants to merge 7 commits into
gol-421-skeleton-clippyfrom
gol-347-typescript-compiler-profiling
Draft

Profile and reduce fresh-runtime TypeScript compiler latency (GOL-347)#134
noise64 wants to merge 7 commits into
gol-421-skeleton-clippyfrom
gol-347-typescript-compiler-profiling

Conversation

@noise64

@noise64 noise64 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add feature-gated, phase-level execution and bounded module/filesystem counters for fresh-runtime TypeScript compiler profiling
  • replace default path-based readFileSync chunk loops with one private native whole-file read while preserving fd and custom-flag fallbacks
  • publish paired schema-v5 P2/P3 reports, focused compatibility coverage, and measured follow-up dispositions

Why

Fresh QuickJS TypeScript compiler jobs spent material time crossing the JS/native boundary for 8 KiB file reads. The controlled profile identified TypeScript import as the selected owner: 1,453 native reads became 68 whole-file reads for the same 10,961,854 bytes.

Five-sample controlled A/B medians:

Target Wasm wall TypeScript import
P2 22.896 s → 20.306 s (-11.31%) 9.626 s → 7.370 s (-23.44%)
P3 22.871 s → 20.291 s (-11.28%) 9.629 s → 7.372 s (-23.44%)

Compatibility

  • ordinary execution remains unprofiled; typescript-compiler-profiling is enabled only for the Agentic TypeScript component
  • readFileSync retains Buffer/string behavior, malformed UTF-8 handling, URL and Buffer paths, fd/custom-flag fallback, and Node-compatible ENOENT/EISDIR metadata
  • queued job lifecycle totals include queue delay and are validated for concurrent compiler/CPU/I/O jobs
  • GOL-348, GOL-349, and GOL-350 remain separate measured follow-ups; GOL-351 remains folded because its hypothesis did not meet the materiality gate

Validation

  • current paired schema-v5 P2/P3 report validation
  • five-sample P2/P3 profiling smoke and clean report regeneration
  • focused P2/P3 fs_read_file_sync_fast_path runtime coverage
  • P2/P3 Node compatibility test_fs_readfile family
  • exact Agentic TypeScript and fs DTS goldenfile tests
  • focused development-profile contract test
  • formatting and failure-safe default/maximal skeleton Clippy matrix
  • independent Codex and Claude correction-delta reviews

Stack

This draft targets gol-421-skeleton-clippy because the profiling work depends on that branch's skeleton/module-loading source state. The base PR's known Rust 1.98 DES3 CBC Clippy correction remains independently gated.

@noise64

noise64 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Exact candidate: ca96cac7800089062826532ebb337f57554bec35.

Correction-delta review is closed:

  • Codex: clear; all four original findings resolved.
  • Claude: clear; all ten correction obligations confirmed. Four low-severity, non-blocking follow-up observations were recorded (feature-label deduplication, two report mutation guards, an uncertain UTF-8 error-path nuance, and a pre-existing custom-flag directory-read divergence).

Independent exact-SHA validation passed:

  • formatting and paired P2/P3 report currentness
  • exact Agentic TypeScript and fs DTS tests
  • P2/P3 focused fs_read_file_sync_fast_path
  • P2/P3 17-case Node readfile family and dedicated readFileSync filters
  • development-profile semantics
  • P2/P3 default and maximal failure-safe skeleton Clippy lanes

The tracked tree remained clean and the skeleton manifest/artifact cleanup contract was restored after validation.

@noise64

noise64 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

CI classification for exact head ca96cac7800089062826532ebb337f57554bec35:

  • build passed and the full matrix was admitted.
  • skeleton-clippy failed only at the stacked base's two known Rust 1.98 clippy::chunks_exact_to_as_chunks diagnostics in src/builtin/web_crypto.rs:680 and :700.
  • The failure is outside the GOL-347 diff and matches the independently recorded GOL-421 authorization gate; no GOL-347 diagnostic appeared.

Remaining exact-SHA CI jobs continue to run. The branch will not absorb a third-cycle GOL-421 correction without the required authorization checkpoint.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant