Closed screeny05 closed 9 months ago
Thanks for pointing this out! I actually wasn't aware of the performance difference between DataView and Buffer. We initially used Buffer but then switched to DataView to support browser environments (https://github.com/keichi/binary-parser/pull/140)
Sure!
I wasn't aware of this as well until i read this article by the v8 dev team:
This will make the benchmark a lot fairer as DataView is pretty optimized in node.js and also because binary-parser itself uses DataView instead of Buffer. Also i upgraded to binparse@2.
Example Results on my machine (Macbook M1 MacOS 14.1).
Before this change:
After this change:
That's more than tripple the speed for the hand-written implementation than before.