Skip to content

perf(jit): reuse native timing storage and settle Tier 2 benchmarks - #19

Open
huacnlee wants to merge 1 commit into
mainfrom
perf/m3-native-timing-stack
Open

perf(jit): reuse native timing storage and settle Tier 2 benchmarks#19
huacnlee wants to merge 1 commit into
mainfrom
perf/m3-native-timing-stack

Conversation

@huacnlee

@huacnlee huacnlee commented Sep 5, 2026

Copy link
Copy Markdown
Member

Issue # (if available)

Follow-up to #18.

Description of changes

Native entry timing used a hash map of per-function vectors, adding lookups and allocations to callback bookkeeping. Replace it with a shared LIFO stack while preserving the original function key and tier through recursion, retirement, OSR, and all exit kinds. Empty or mismatched exits preserve other active records. After warming one slot, inserting timers for 100 sequential distinct functions now performs zero allocations instead of 105.

The performance controls also exposed forced Tier 2 timing before its caller finished compiling. Add an explicit publication requirement for call-heavy, stable compilation settling, and rejection of compilation during required-Tier2 timing. Refresh the changed script checksum and three pre-existing stale local manifest hashes.

Archive profiles and four paired comparisons against merged M3 with identical corrected harnesses and balanced engine order. Generic automatic measures 1.011x baseline speed, with its interval only narrowly excluding parity. Generic Tier 1 and recursive Tier 1 are statistically tied with broad intervals; direct-call modes are also tied. These dirty-source diagnostics do not establish overall speedup or complete the broader clean-source performance acceptance gate. Documentation retains the original readiness-defect evidence and explains the superseded measurement limitations.

Validation:

  • 515 release runtime tests passed.
  • 87 runtime AddressSanitizer/LeakSanitizer tests passed.
  • 28 benchmark tests and two forced-Tier2 sanitizer tests passed.
  • Allocation and premature-readiness regressions were verified red before the fixes.
  • Full-workspace Clippy and formatting passed.
  • Final measurement audit verified matching checksums, balanced native enter/exit counts, executable/source hashes, and 15/15 latency plus 5/5 throughput first-run order in every mode.

Checklist

  • Added change to the changelog
  • Created unit tests for my feature if needed

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