I'm working on an idea to benchmark the performance of different implementations for processing bytes in pure Roc. My objective is to have something that can give me real feedback for various ideas to speed up json decoding.
What I have so far is relatively simple, but I would appreciate any feedback on ways to improve this. I have never really benchmarked anything before, and I played around with hyperfine
and time
commands but feel like just timing things from within Roc is probably also acceptable for now. It would be good to know if there are better ways to do this.
Specifically, I'm looking for better ways to time the processing logic. :smile:
My current idea is in this gist and uses this twitter.json benchmark file.
Checking the flamegraph and branch+cache misses with perf will likely give you additional insight into the difference in performance for different implementations.
Flamegraphs currently aren't the most usable on a roc executive
Last updated: Jul 05 2025 at 12:14 UTC