bytecodealliance / bytecodealliance/ComponentizeJS

Component Size & Performance: JCO/SpiderMonkey vs QuickJS

Đang mở
#291 9 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
391
Fork
53
Merge trung bình
3 ngày 5 giờ
Pull request đã merge (30 ngày)
1

Mô tả

Hi there,

Let me start by saying that I'm missing a lot of context and that my approach is extremely naive, so please tell me to bugger off. Yet, I would still like to better understand the rational or state-of-the-world.

I'm playing around with various WASI components, mostly in Rust and JS. I did certainly notice the chunky component size of my JS components whenever wasmtime had to recompile them. I didn't think too much of it, thinking that's just the price to pay for bundling an interpreter. However, eventually I built a rust WASI component bundling QuickJS (via the rquickjs crate), which turned out to be slightly faster and significantly smaller. For comparison:

1. JCO => 13M
2. JCO + weval/aot => 29M
3. Rust + QuickJS => 1.9M

Running a naive fibonacci implementation just to get a sense of performance, I get for `fib(40)`:

1. JCO => 45s
2. JCO + weval/aot => 29s
3. Rust + QuickJS => 26s

And startup codgegen/compile times are hugely different roughly propotional to the difference in component size.

I've no clue if this actually SpiderMonkey or if there's something else going on, however I didn't expect the difference to be quite so substantial. Could you help me understand what I'm missing or is this an opportunity?

Thanks,
Sebastian

EDIT: I'm happy to back this up with code-examples, I mostly just wanted to reach out and see if this is something you're aware off or have seen before.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Tái hiện ba kích thước component đã được báo cáo, thời gian chạy fib(40) và thời gian tạo mã khi khởi động cho JCO, JCO với weval/aot và Rust với QuickJS. Issue không nêu tệp, test hoặc entry point nào, vì vậy hãy bắt đầu bằng cách yêu cầu hoặc tìm các ví dụ mã đã được hứa cung cấp và kiểm tra xem SpiderMonkey có phải là nguyên nhân hay không. Được xem là hoàn tất khi giải thích được sự chênh lệch hoặc xác định được một cơ hội tối ưu hóa cụ thể.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, rust, wasm
Lĩnh vực
compilers, performance
Loại issue
Lỗi
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.