-
Notifications
You must be signed in to change notification settings - Fork 205
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
Mention WebAssembly? #51
Comments
Sure, why not :) Currently it's in the release notes only. |
What do you think of adding this paragrapth below the API: WebAssembly supportWebAssembly supports 64-bit integer arithmetic out of the box, hence a tiny WebAssembly module is used to compute operations like multiplication, division and remainder more efficiently (slow operations like division are around twice as fast), falling back to floating point based computations in JavaScript where WebAssembly is not yet supported, e.g., in older versions of node. |
I guess there's also a performance gain, you could talk about it too. |
I did some more careful measurements now, I see the following speedups when using wasm:
(the range is from comparing on a bunch of different VMs). I think this could be summarized as "slow operations like division are around twice as fast". |
Alright, the updated paragraph above is in the README now. It's not possible to just switch the README on npm, though, so we'll have to wait for another version update. Maybe implementing ctz, clz, rotl, rotr (see #45) and maybe others might be a good cause :) |
@dcodeIO I think this information is important enough to make a new release to update the README on npm (even if it's just a patch). |
Now that there is optional wasm optimization here, maybe it's worth mentioning that on the main page here and on https://www.npmjs.com/package/long ?
The text was updated successfully, but these errors were encountered: