| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
⚠️ Please install the Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
==========================================
+ Coverage 98.07% 98.10% +0.02%
==========================================
Files 16 16
Lines 1092 1106 +14
Branches 249 251 +2
==========================================
+ Hits 1071 1085 +14
Misses 21 21 ☔ View full report in Codecov by Sentry. |
Sorry, something went wrong.
|
Hi, @eddig. Thank you for your contribution. This PR could boot performance in particular cases, but extending the MessagePack format might break compatibility with other MessagePack processors. Padding is okay, but changing Decoder might not be a good idea. Could you please re-consider the format that does not affect Decoder in order not to break the compatibility? |
Sorry, something went wrong.
|
Hi @gfx I agree that breaking compatibility is possible in the current state. Let me go ahead and write down my considerations so far. There are two places to add the padding I see.
In the first case, we must be sure that the padding byte doesn't intersect with the other extension type bytes. const decoded = decode(encoded, { extensionCodec, useAlignment: true });In the second case, we must be sure that we do not mess up the padding and data. So far I see only one way to do that, it is by adding an extra byte that tells us the number of the padding bytes we should offset to reach the actual data. That solution means that we add an extra byte for any data encoded with the extension codec with enabled alignment even if the data is already aligned. What do you think? |
Sorry, something went wrong.
|
For me, the ideal solution would be to provide the current position in the filling buffer to the encode function of the extension codec. In that case, I can calculate how many padding bytes I should add to my data to keep it aligned. Then in the decode function, I skip the padding bytes and build a typed array. I'll give it a try to verify that it is conceptually doable. |
Sorry, something went wrong.
|
I've proposed another solution here #248 |
Sorry, something went wrong.
|
Yes, we should conentrait on #248 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This update introduces a solution to handle data alignment in custom extensions, ensuring that encoded data is aligned in memory according to specified requirements. The main benefit of this approach is enabling zero-copy deserialization, which significantly enhances performance when working with data types like Float32Array that have strict alignment needs.
Key Steps:
Alignment Handling in Encoding:
Padding Skipping in Decoding:
Storing Alignment Information:
Modification of the ExtData Class: