-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use list of string lengths + list of strings instead of escaped null-terminated strings #11
base: master
Are you sure you want to change the base?
Conversation
…terminated strings
Also, I suspect that this will improve compression a little bit. |
Checked the file size with facebook files in binjs-ref repository. also, checked another variant that sorts the string dictionary by length first. unfortunately this change mostly increases the file size. Apparently the length part isn't much compression-friendly compared to null-terminator.
|
Thank you for running this analysis @arai-a |
there are 2 problems that this is supposed to solve:
the latter issue about "even if there's no escaped 0x01 or 0x00 in strings" can be solved by separating dictionary for strings that contains 0x01/0x00 and others. but having 2 dictionary structure just for that purpose doesn't sound reasonable for me. then, there is the following thing that in either way the decoder have to do:
So, in any way we have to iterate over the strings at least once (or twice if we decode), |
changed String dictionary section to the following,
now we don't have to do escape, nor look for 0x01/0x00 while reading.