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

JavaScript now has 64-bit integer support #17

Open
LJNeon opened this issue May 30, 2019 · 1 comment
Open

JavaScript now has 64-bit integer support #17

LJNeon opened this issue May 30, 2019 · 1 comment

Comments

@LJNeon
Copy link

LJNeon commented May 30, 2019

With the addition of BigInt, JavaScript now has a type that can reliably store snowflakes as Integers. This type has been in node.js for almost a year now, and uses an average of 40% less memory to store snowflakes compared to Strings. I haven't tested it, but I also suspect this will be easier and/or faster to convert to than Strings are as well. For full disclosure, tests done by the Dyno team showed that the 40% decrease in memory for snowflakes made no noticeable difference in the total memory usage. I'm not stating that erlpack absolutely must switch over, as this would also be a major breaking change for the JavaScript DAPI libraries that utilize erlpack, but I thought I would at least bring up the idea and invite discussion.

@devsnek
Copy link

devsnek commented May 30, 2019

we experimented with this in discord.js a bit (https://github.com/discordjs/erlpack/tree/feature/bigint) and i also support this in earl (https://github.com/devsnek/earl)

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

2 participants