Developer]
According to Google, you’ll be able to rarely ever have to run microbenchmarks. Still, some developers will find it useful once they see if a bit of code they’re engaged on is actually worth it. While there are tools available to run microbenchmarks, Google thought it’d be a good suggestion to make its own.
Google announced today that it has created a brand new microbenchmarking tool called benchmark. The tool is built on a C++ library and was inspired by googletest. The tool “supports value- and sort-parameterized benchmarks, various options for running the benchmarks including multithreading, and custom report generation.”
While benchmark is predicated on googletest, Google notes that there’s a major difference between both. In benchmark, benchmarks aren’t automatically discovered like they’re in googletest. This isn’t a foul thing though as Google notes the dearth of automatic discovery “allows greater flexibility in relation to how benchmarks are run, and the parameters which can be utilized by the benchmark.”
Here’s what benchmark seems like:
As is the case with a lot of these tools, benchmark is an open source project. You could test it out on github and begin contributing. For those who just wish to use it, you’ll also find test code on its github page in addition.
Google Introduces Benchmark For Your entire Microbenchmarking Needs 10 hours ago