Stream: general

Topic: Improving JCO componentize times


view this post on Zulip Shalev Goodman (Oct 06 2025 at 20:19):

Hi, I'm trying to use jco to compile a 151 single JS file and it takes about 6 seconds to compile on my M4 macbook. I was wondering why does it take so long? and are there any ways that I can configure jco to compile faster taking into account that I'm only going to compile a single JS file that has external WASI dependencies.

view this post on Zulip Victor Adossi (Oct 07 2025 at 09:08):

Hi there -- what are the arguments you're using to Jco? jco calls componentize-js under the covers, and that might be a good place to get a baseline. Without knowing anything about your project it's hard to say if there's anything that might be uniquely making it slow, but I think that's just the speed of the tooling right now.

Trying to build the adder example component from Jco takes 13s on my machine, for example.

ComponentizeJS does work to generate interfaces and splice your script into the StarlingMonkey runtime underneath.

I don't think componentization speed has been that much of a focus, but we certainly welcome PRs over at https://github.com/bytecodealliance/ComponentizeJS . There might be quite a bit of low hanging fruit, optimization wise!

What problem are you trying to solve? Are you trying to execute dynamic JS faster, with a static set of imports?

JS -> WebAssembly Component. Contribute to bytecodealliance/ComponentizeJS development by creating an account on GitHub.

view this post on Zulip Shalev Goodman (Oct 07 2025 at 14:05):

I forked the componentize-js repo last night and managed to find some low hanging fruits that got me from 6 seconds to 1 second. I will open a PR later today :)

Thank you for taking the time to answer my question!

view this post on Zulip Shalev Goodman (Oct 07 2025 at 16:23):

PR is open https://github.com/bytecodealliance/ComponentizeJS/pull/298

I appreciate all feedback, and I will make any necessary changes to get this over the finish line :)

The goal of this PR is to increase the time it takes to compile a JS file into a WASM component. AI disclaimer I used AI in the creation of this PR. Specifically the Cursor composer (Claude-4.5-son...

view this post on Zulip Victor Adossi (Oct 08 2025 at 15:30):

A bit late here but awesome work @Shalev Goodman ! :rocket:


Last updated: Dec 06 2025 at 05:03 UTC