Closed orbitlens closed 1 year ago
Wow, Herculean stuff 👏 It'd be nice if we had .x -> .js tests to see if there were any output changes.
I tried generating .x -> .js
with examples/test.x
(via yarn run test-generate
), but of course it makes sense to test with .x files from stellar-core. Could you please check the generated output for the difference? Because I'm a bit lost between various versions of stellar-core
and curr/next XDR.
Great work. thanks @orbitlens!
long
dependency with nativeBigInt
arithmetics.lodash
dependency with built-in Array and Object methods, iterators.buffer
dependency for WebPack browser polyfill.Minified browser bundle size decreased from 335 KB (prev version) to 43 KB (this version). Memory consumption during serialization decreased due to the smaller writer buffer allocation.
We already actively use it as a drop-in replacement for original
js-xdr
package for ingestion. So far, no compatibility issues have been found.Also I created a primitive performance benchmark for Node.js to test serialization/deserialization speed for refactored version vs original. It shows significant performance boost, up to 5X depending on the serialized type.
Benchmark link. Benchmark results on my computer: