bytecodealliance / bytecodealliance/ComponentizeJS

Component Size & Performance: JCO/SpiderMonkey vs QuickJS

Aberta
#291 9 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Rust
Estrelas
391
Forks
53
Merge médio
3d 5h
PRs com merge (30d)
1

Descrição

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.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Reproduza os três tamanhos de componente relatados, os tempos de execução de fib(40) e os tempos de geração de código na inicialização para JCO, JCO com weval/aot e Rust com QuickJS. A issue não menciona arquivos, testes ou pontos de entrada; portanto, comece solicitando ou localizando os exemplos de código prometidos e verificando se o responsável é o SpiderMonkey. O trabalho estará concluído quando a discrepância for explicada ou uma oportunidade concreta de otimização for identificada.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
javascript, rust, wasm
Domínio
compilers, performance
Tipo de issue
Bug
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Pouca atividade
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
25/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.