Profile and reduce Oxide code-image startup, peak RSS, and package size
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 44/100
- Issue-Typ
- Refactoring
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- rust
- Bereich
- performance
Rechercherichtung
Start with the remaining initialization work: examine object, closure, and cell allocation and capped-heap accounting, then compare the identified Hero script-turn cost with QJBC. Use the existing Hero replay and report changes against the recorded instruction counts; image decoding and instantiation are also named areas to measure. The issue sets a separate rollout gate: record identical Tab5 release package results against the device QJBC ABI and exercise packaged workers before changing the default engine.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Baseline
Stock PocketJS Hero, Linux x86-64, same release replay host, same bundle and assets, 20 boot-only samples per engine in ABBA order.
| Metric | Oxide OXBC v2 | QuickJS QJBC (NG 0.16.2) |
|---|---|---|
| Boot median | 10.76 ms | 6.33 ms |
| Median process peak RSS | 10,776 KiB | 8,046 KiB |
| UI bytecode section | 480,993 B | 148,909 B |
The compiler-free Oxide host matched QJBC for all 360 replay frames, the ordered host-call trace, and the final framebuffer.
Work
- Account for bytecode bytes by section and attribute startup instructions and allocation peaks across package admission, realm and host setup, decode, relocation/publication, instantiation, and first execution.
- Land and measure the first round of improvements to the dominant costs. Recheck the same Hero replay, format rejection before execution, no-draw boot, process peak RSS, UI bytecode bytes and the engine Sweep.
- Validate the rollout on Tab5 with the release ESP-IDF QuickJS QJBC ABI and exercise the PocketJS worker path. Record that evidence before changing the default engine.
First optimization round
The paired rerun used Linux CPU 2, the same original Hero bundle and assets, and 20 boot-only samples per arm. QJBC ran through the existing PocketJS C guest.
| Metric | OXBC v2 | OXBC v3 | QuickJS QJBC |
|---|---|---|---|
| Boot median | 10.85 ms | 9.00 ms | 6.34 ms |
| Median boot peak RSS | 10,728 KiB | 9,628 KiB | 8,092 KiB |
| UI bytecode section | 480,993 B | 289,412 B | 148,909 B |
- Fixed-width instructions and position tables accounted for 79.8% of OXBC v2. V3 uses variable-width immediates and delta-coded source positions and preserves backtraces.
- Massif attributed 1,034,592 bytes to an eager copy of the asset pak. When the native registry has mounted assets, the guest creates the private
__pakbuffer on first access. Massif's sampled live allocation peak dropped from 5,667,338 to 4,441,015 bytes. - Loading now validates the relocated tree's input once and uses its explicit tree links for instantiation. Callgrind attributed 17.68M instructions to v2 loading and 12.37M to v3 loading.
- The capped heap skips growth calculations for arenas with zero requested records. The capacity-check work dropped from 11.55M to 10.25M instructions at the same 19,228 checks. One collection ran on the profiled boot.
- The compiler-free host still matched QJBC for 360 frames, the host operation log and the final pixels. The release build rejects v2 before effects, and a v3 exception after a host operation stops startup. The instruction and loop-size Sweep gates passed after refreshing linker symbol ordering. The 37-workload engine peak-RSS geometric mean was 0.998×.
Remaining
- Reduce the initialization cost. Hero's Oxide script turn accounts for 42.00M instructions compared with 28.52M in QJBC's script execution. Examine object, closure and cell allocation and capped-heap accounting. Image decoding and instantiation still account for 7.72M and 4.65M instructions respectively.
- Measure identical Tab5 release packages against the device QJBC ABI and exercise packaged workers. The Linux QJBC results above are for the native diagnostic ABI.
- Vorherrschende Sprache
- Rust
- Sterne
- 61
- Forks
- 2
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Die Einrichtungsdateien dieses Projekts haben wir noch nicht geprüft. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus pocket-stack/quickjs-oxide
-
performance.now() bypasses Host and uses std::time::Instant (unsupported on wasm32-unknown-unknown)Offenbug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
pocket-stack/quickjs-oxide#165 · 1 Kommentar ·
-
Two public SystemHost types: the core one is always UTC, the host crate's uses the system time zoneOffenenhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
pocket-stack/quickjs-oxide#164 ·
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 56/100
pocket-stack/quickjs-oxide#163 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
pocket-stack/quickjs-oxide#158 · 1 Kommentar ·
-
Execution slow paths: inline-cache misses (Gameboy), typed-array access (zlib), array stores (Sieve)Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
pocket-stack/quickjs-oxide#157 ·
Alle Issues in pocket-stack/quickjs-oxide
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Wait for the IDS correction dialog to settle in the stale-audit testEvtl. vergeben @louistrue hat das heute übernommen. Offenready
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
dutchman-cad/dutchman#874 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue ready
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
MartinPTielemans/ilo#3840 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug file-compat priority: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
storytold/wordcraft#7248 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 4 Tagen