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

feat: compress indices #6

Open
KnorpelSenf opened this issue Nov 28, 2022 · 0 comments
Open

feat: compress indices #6

KnorpelSenf opened this issue Nov 28, 2022 · 0 comments

Comments

@KnorpelSenf
Copy link
Owner

Object and array indices often have a sequence of numbers (

["", 1, 2, 3, 4, 5, 6],
) or a single number repeated many times (
assertEquals(listify([1, , , , -1, ,]), [[1, -2, -2, -2, 2, -2], 1, -1]);
).

It is trivial to compress these things down into a much more space-efficient version. This will greatly reduce the number of bytes used in the serialised form. It will in no case increase this number of bytes.

The runtime complexity will remain identical. Perhaps there is a change in the constants, but it isn't clear upfront in which direction the change will happen. This should be benchmarked.

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