hcl-rs icon indicating copy to clipboard operation
hcl-rs copied to clipboard

feat(bench): Make it easier to profile benchmarks

Open epage opened this issue 2 years ago • 3 comments

These are practices I pulled over from toml_edit when working on the performance regression caused by winnow-rs/winnow#98. Feel free to pick and choose what you want from this.

epage avatar Jun 14 '23 20:06 epage

Thanks. I read your recent blog post about testing, but I'm still not sure how this can help with profiling. Is it because you avoid the libtest/criterion layer here?

martinohmann avatar Jun 18 '23 21:06 martinohmann

This was all independent of my blog post

Pinning the lockfile makes profiling results more reproducible (two people can profile a commit and get the same relative results)

prolfile.release.debug is recommended in the performance book

As for the program, maybe there are good ways to profile benches but I didn't find one quick enough, so I made them standalone that made it easy for me to profile the cases I cared about for toml_edit. I then carried that over.

epage avatar Jun 19 '23 14:06 epage

I see, thanks for the clarification!

martinohmann avatar Jun 19 '23 14:06 martinohmann

@epage This has been sitting here for almost a year now because I was hesitant for a while and then I simply forgot about it. It's conflicted now. If you can spare some of your valueable time to rebase it, I'd be happy to merge it. :)

martinohmann avatar May 17 '24 22:05 martinohmann

Eh, haven't had a need in this for a while

epage avatar Jun 06 '24 21:06 epage