Skip to content

Load coeffs.bin separately from wasm code in webzebra #18

Open
@panstromek

Description

@panstromek

Currently, the coeffs.bin file is baked into the the wasm bundle with include_bytes macro, but this is not ideal, because it makes the bundle about 6 times bigger. Also the file never changes, so while we could in theory let browser and CDN cache it forever, we invalidate it on every build, whenever we change something in wasm code.

We can instead load the file separately and then copy it into wasm memory. This could make webzebra load slower because we would have to copy the file into wasm memory, but it could also make it faster, because we can download this file in parallel with loading+parsing wasm and wasm parser will have less stuff to parse. If the file is cached in the browser, this could be even faster because we wouldn't have to load it at all. I'd like to see numbers on this method.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions