Skip to content

Run aabb in wasm #850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

rikhuijzer
Copy link
Contributor

This is 30% faster. Plotting 1000 circles now takes less than 1 s on my system 🚀 (down from 1.6 s).

This is mostly due to removing this line though:

assert(type(pt) == array and pt.len() == 3, message: repr(init) + repr(pts))

This check is now still done inside wasm. If the pt is not an array the program will error when trying to parse the incoming cbor data.

Also, Rust found a small bug, if you can call it that. Usually a pt is a Vec<f64>, but sometimes inside CeTZ a 0 (integer) was introduced instead of a float.

This PR depends on #848. I'll leave this one on draft until the other PR is merged.

Just removing the assertion in aabb.typ already saved 30%. Apart from
that, switching to WebAssembly has no effect except that it found a bug
where floats and integers were put together in an array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant