Compile is 1.5–3× slower than QuickJS: the stack-code layer and front-end allocation
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- compilers, performance
Hướng nghiên cứu
Start with the compiler path described in the issue: lexer and parser, FunctionIr, resolution, lowering, flow, and register::analysis; use compile_matrix.py and the listed profiles to locate the measured costs. The proposed direct IR-to-register lowering and front-end allocation changes span several compiler subsystems. Done means reaching within 1.5× of QuickJS on every listed corpus row while keeping Test262, the differential corpus, and register-stress unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Compile-only throughput of 0.3.0 against QuickJS 2026-06-04 (compile_matrix.py, generated corpus, one process per sample, median of 5, Ryzen 7 7840HS):
| Corpus | Size | oxide MB/s | QuickJS MB/s | QuickJS faster by |
|---|---|---|---|---|
| expressions | 64 KB | 11.7 | 27.2 | 2.3× |
| expressions | 512 KB | 10.0 | 29.7 | 3.0× |
| expressions | 4 MB | 10.3 | 25.0 | 2.4× |
| functions | 64 KB | 8.1 | 14.1 | 1.7× |
| syntax-mixed | 64 KB | 6.8 | 10.3 | 1.5× |
(At 512 KB and 4 MB the functions and syntax-mixed corpora are superlinear in QuickJS, so those rows are left out; see the name-resolution issue for ours.)
The whole-program effect shows in Octane CodeLoad, 2.32× QuickJS's time: 56% of its samples are in the compiler and another 33% in malloc/free, mostly compile-time allocation. Top symbols: Lexer::next_token_into 8.8%, _int_malloc 4.8%, Parser::probe_token 4.7%, lowering::lower_unlinked_tree 4.1%, lowering::lower_ops 4.1%, register::analysis::analyze 4.0%.
Where the work goes
Source reaches register code through: lexer and parser → linear FunctionIr → resolution → lowering to QuickJS-shaped stack code (UnlinkedFunction) → relocation/flow/optimize → register::analysis (re-derives stack depth and catch regions per instruction) → register lowering → CodeStore::publish validation. QuickJS emits bytecode while parsing and then runs resolve_variables and resolve_labels.
- The stack code is a complete intermediate representation (instructions, constants, debug tables, closure-variable tables) whose only consumer is the register lowering.
- Stack depth is computed twice (
flowandregister::analysis); source positions are projected for stack code and mapped again for register code. - The lexer re-scans by cloning itself (
probe_token), and the front end allocates per identifier and per function table without an arena.
Direction
- Lower from the IR (after
resolution) straight to register code, removing the stack-code layer and its second analysis. - Until then: hand
flow's depths to the register lowering instead of recomputing them; cut front-end allocation (arena or reused buffers; no lexer clones for lookahead).
Acceptance: compile throughput within 1.5× of QuickJS on every corpus row above, with Test262, the differential corpus and register-stress unchanged.
- Ngôn ngữ chính
- Rust
- Star
- 61
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pocket-stack/quickjs-oxide
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 44/100
pocket-stack/quickjs-oxide#192 · 3 bình luận ·
-
performance.now() bypasses Host and uses std::time::Instant (unsupported on wasm32-unknown-unknown)Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
pocket-stack/quickjs-oxide#165 · 1 bình luận ·
-
Two public SystemHost types: the core one is always UTC, the host crate's uses the system time zoneĐang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
pocket-stack/quickjs-oxide#164 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
pocket-stack/quickjs-oxide#163 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
pocket-stack/quickjs-oxide#158 · 1 bình luận ·
Tất cả issue của pocket-stack/quickjs-oxide
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Wait for the IDS correction dialog to settle in the stale-audit testCó thể đã có người làm @louistrue đã nhận hôm nay. Đang mởready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
dutchman-cad/dutchman#874 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The address-wrap test for a path that fits a line fails on a machine without Inter installedĐang mởbug good first issue ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MartinPTielemans/ilo#3840 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug file-compat priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
storytold/wordcraft#7248 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày