Object model step 4: performance and memory regressions to win back in step 5
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 8/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust, typescript
- Domain
- compilers, performance
Research direction
Start with the step 4 merge (#12617) and reproduce the JSON parse + field sum ×20 benchmark, comparing instruction counts and max RSS against main. The payload names the JSON.parse record overflow table and the site caches as the causes, but no source files, so locate them from #12617. Done means the regressed benchmarks return to at or below the step 4 numbers with identical outputs; the layout-based record birth and the step 5 probe are design work for maintainers.
Written by the indexing model from the issue text.
Description
Object model step 4 (#12617) landed with accepted performance and memory regressions; step 5 (unknown-receiver probe) wins them back. Measured on main 20a676979 vs the step 4 merge (instructions:u n=3, max RSS n=3, outputs identical):
| program | Δinstr | ΔRSS |
|---|---|---|
| JSON parse + field sum ×20 (20k records, 5 fields) | +234.6% | +93.8% (74 → 143 MB) |
| fastify inject | +7.96% | −1.5% |
| effect/main | +6.41% | +0.1% |
| tscwork | +3.75% | −1.0% |
| commander construct | +3.28% | +0.6% |
| zodwork | +3.10% | −0.3% |
| qs parse_nested | +2.76% | +1.3% |
| commander parse_argv | +1.24% | +0.2% |
| qs stringify_nested | +0.55% | +0.3% |
| JSON round-trip ×20 | +0.01% | +0.1% |
| binarytrees, buffer_heavy, root-survival, worker, hello | ≤ +0.74% | ≤ +1.1% |
Causes known so far:
- JSON.parse records carry an overflow table from birth (about 496 B for a 3-field record); every field read on them leaves the site caches.
- fastify: 3 long-lived objects (instance/route context) get an overflow from
decorate(name, v); about 318k slow reads per run. 21k EventEmitter_eventsmaps and 16k JSON.parse objects get overflows. - Sites and memos don't serve receivers with an overflow until step 5.
Fix: JSON.parse records born with the layout of their key list (no overflow); step 5's probe of the layout key index / overflow index in compiled code.
- Dominant language
- Rust
- Stars
- 4.9k
- Forks
- 166
- Avg merge
- 2h 20m
- Merged PRs (30d)
- 916
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PerryTS/perry
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wasi-gfx/wasi-gfx-runtime#152 ·
-
area:cli bug good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aaif-goose/goose#13031 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day