-
Notifications
You must be signed in to change notification settings - Fork 51
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
[Enhancement] Allow custom string dictionary + use location of repeated strings #122
Comments
I am looking for this enhancement too. I think the |
You might consider using CBOR packing, which was designed for this purpose: |
@kriszyp Thank you very much! Great results! |
I didn't know this package existed, and wrote my own, doh. But mine is scoped too heavily for my project. I want to switch to something a bit more flexible that has community support, and would love to get some of the reductions I implemented. In msgpackr for strings, I've been unable to get any boost from
bundleStrings
, which was odd.Enhancements:
Allow custom string dictionary. An array of commonly used strings that is fed identically to both
Packr
andUnpackr
. It should only take up two bytes per string to lookup against this table for dictionary length of 255.Store location of repeated strings instead of encoding strings twice. If "hello" gets encoded at byte position
53
, and the serializer sees "hello" again later, it should just encode the location position53
for that 2nd "hello". Again, taking only 2 bytes or more if distance is greater than 255.Feel free to see my own awful implementation, acos-json-encoder.
Edit: link goes to line where I implemented
The text was updated successfully, but these errors were encountered: