Skip to main content

3 posts tagged with "WebAssembly"

The Rust and C code compiled to Wasm underneath the runtime.

View All Tags

A Nuxt dev server in a tab cost 3.46 GB, and the biggest thing we could actually shrink was the filesystem

· 10 min read

A tab running nuxt dev was using 3.46 GB. That is not a number you optimise your way out of with a hunch, and the hunch everybody has is the same one: bundlers are memory hogs, so it must be the bundler.

It was not the bundler, whose entire contribution was 22.5 MB. It was three other things, and they are not even measured in the same units: a filesystem holding 929 MB of node_modules as bytes, a persistence layer writing 4.7 GB to store 53 MB, and an editor spending 621 MB parsing one set of type definitions twice.

This post is the autopsy rather than a list of tips, because the useful part is which assumptions turned out to be wrong.

There was never a second import pandas, and PEP 552 is why there is now

· 11 min read

On your laptop, the first import pandas of the day is slow and every one after it is fast. You have probably never thought about why. CPython compiles the package's .py files to bytecode, writes that bytecode into __pycache__, and never does it again.

Run Python inside a browser tab, where every command is its own process with its own interpreter and a freshly unpacked copy of every package, and something uncomfortable follows. There is no second time. Every import pandas is the first one.