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

Increase range for single id in Tuple (from 16 to 32bits) #289

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Increase range for single id in Tuple (from 16 to 32bits) #289

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 16, 2017

Now single id in Tuple can be in higher range (32 bits per id) thanks to ArrayBuffer

first we store each id in ArrayBuffer/DataView(8 bytes = js number) as uint32 at 0 byte and 4 byte
second step is to get key by getting js number (8 bytes from whole buffer)

thats it! :D

the key thing, it is a bit slower when you do this 100 000 times at once:

https://jsfiddle.net/9zsrf0rx/

but if "tries" is set to 1000 its almost the same and sometimes a bit faster.

Maybe we can colaborate about this a bit to make it even better.

Kamil93 added 2 commits March 16, 2017 22:32
Now single id in Tuple can be in higher range (32 bits per id) thanks to ArrayBuffer

first we store each id in ArrayBuffer/DataView(8 bytes = js number) as uint32 at 0 byte and 4 byte
second step is to get key by getting js number (8 bytes from whole buffer)

thats it! :D
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.

0 participants