Run hello_world::exclaim() or some new, more interesting sample function like hello_world::do_expensive_work() for N iterations in N threads. Make these options configurable.
[x] Add bench/run-concurrent.cpp
[x] Add it to the build as another executable target
[x] Add a make bench target that runs both the first benchmark and this one
We should have benchmarks that test the code.
Phase 1
Extremely simple and bare bones. But this would be extremely useful for downstream devs writing simple libs off hpp-skel.
make bench
target that runs the benchmarkUseUsing google benchmark insteadstd::chrono
to time how long it takes to callhello_world::exclaim()
10,000 times;We can use https://github.com/mapbox/vector-tile/blob/master/bench/run.cpp as a reference.
Phase 2
Run
hello_world::exclaim()
or some new, more interesting sample function likehello_world::do_expensive_work()
for N iterations in N threads. Make these options configurable.make bench
target that runs both the first benchmark and this oneCould use https://github.com/mapnik/mapnik/blob/441687ecff6b906c86fde456034f8cab1b767a87/benchmark/bench_framework.hpp#L29-L97 as a reference point for a multithreaded/concurrent benchmark.
Phase 3
Integrate and example of using https://github.com/google/benchmark which was recently packaged in mason for mbgl: https://github.com/mapbox/mason/pull/467