Profile and reduce Oxide code-image startup, peak RSS, and package size

Ouverte
#192 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
44/100
Type d'issue
Refactorisation
Clarté
Plutôt claire
Activité
Active
Stack technique
rust
Domaine
performance

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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 __pak buffer 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.
Langage dominant
Rust
Étoiles
61
Forks
2
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Nous n'avons pas encore vérifié les fichiers d'installation de ce projet. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de pocket-stack/quickjs-oxide

Toutes les issues de pocket-stack/quickjs-oxide

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.