Use list of string lengths + list of strings instead of escaped null-terminated strings#11
Use list of string lengths + list of strings instead of escaped null-terminated strings#11arai-a wants to merge 1 commit intobinast:masterfrom
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.