Skip to content
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

Explore options to update long emulation #9909

Open
niloc132 opened this issue Jan 29, 2024 · 0 comments
Open

Explore options to update long emulation #9909

niloc132 opened this issue Jan 29, 2024 · 0 comments

Comments

@niloc132
Copy link
Contributor

GWT's existing long emulation was last updated in 2015, with a few assumptions that might no longer be true. Among other things, it retains the earlier assumption that 24bit ints are faster to operate on than larger values. Unfortunately, there appear to be no public benchmarks (the old gwt-benchmark repo only has add/multiply benchmarks, and add is all "Small" values), so we might need to work up some acceptable examples to do this work.

Contrast with J2CL's current implementation of long, which uses closure-library's own long.js (intended to reflect java long behavior as well). This implementation uses two 32bit values, occasionally splitting to 16bit values for operations like add/multiply/etc (though not bitwise operations), whereas GWT operates on 13 bit values, and appears to end up doing more work.

Also consider BigInt - with the demise of IE11, this should be well supported. This may require introducing changes to the JS AST or JSNI parser.

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

No branches or pull requests

1 participant