Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(891)

Issue 2865663003: Adding Google benchmarking library. (Closed)

Created:
3 years, 7 months ago by dyaroshev
Modified:
3 years, 7 months ago
Reviewers:
danakj, jdoerrie, brettw, nduca
CC:
chromium-reviews, danakj+watch_chromium.org, vmpstr+watch_chromium.org, Alexander Yashkin
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Adding Google benchmarking library. In Chromium we do not have general tools for writing microbenchmarks, even though we need it. Therefor we constantly reinvent the wheel and resulting benchmarks take very long time to write, much less precise than they should be, run longer than they can etc. Some examples: https://cs.chromium.org/chromium/src/base/json/json_perftest.cc https://cs.chromium.org/chromium/src/base/message_loop/message_pump_perftest.cc https://cs.chromium.org/chromium/src/base/threading/thread_perftest.cc https://codereview.chromium.org/2745733005 https://codereview.chromium.org/2854353002 Google has an open source library: https://github.com/google/benchmark for doing microbenchmarking. It has decent documentation and there is also a talk at CppCon by Chandler Carruth https://youtu.be/nXaxk27zwlk This cl adds this library to third party and adds a small example using it. BUG=682215

Patch Set 1 : Sketch. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11680 lines, -4 lines) Patch
M PRESUBMIT.py View 2 chunks +3 lines, -3 lines 0 comments Download
M base/BUILD.gn View 2 chunks +12 lines, -0 lines 0 comments Download
M base/DEPS View 1 chunk +2 lines, -1 line 0 comments Download
A base/containers/containers_benchmarks.cc View 1 chunk +54 lines, -0 lines 0 comments Download
A base/test/run_all_base_microbenchmarks.cc View 1 chunk +7 lines, -0 lines 0 comments Download
A third_party/google_benchmark/.clang-format View 1 chunk +5 lines, -0 lines 0 comments Download
A third_party/google_benchmark/.travis.yml View 1 chunk +150 lines, -0 lines 0 comments Download
A third_party/google_benchmark/.travis-libcxx-setup.sh View 1 chunk +28 lines, -0 lines 0 comments Download
A third_party/google_benchmark/.ycm_extra_conf.py View 1 chunk +115 lines, -0 lines 0 comments Download
A third_party/google_benchmark/AUTHORS View 1 chunk +38 lines, -0 lines 0 comments Download
A third_party/google_benchmark/BUILD.gn View 1 chunk +56 lines, -0 lines 0 comments Download
A third_party/google_benchmark/CMakeLists.txt View 1 chunk +202 lines, -0 lines 0 comments Download
A third_party/google_benchmark/CONTRIBUTING.md View 1 chunk +58 lines, -0 lines 0 comments Download
A third_party/google_benchmark/CONTRIBUTORS View 1 chunk +56 lines, -0 lines 0 comments Download
A third_party/google_benchmark/LICENSE View 1 chunk +202 lines, -0 lines 0 comments Download
A third_party/google_benchmark/README.chromium View 1 chunk +14 lines, -0 lines 0 comments Download
A third_party/google_benchmark/README.md View 1 chunk +726 lines, -0 lines 0 comments Download
A third_party/google_benchmark/appveyor.yml View 1 chunk +56 lines, -0 lines 0 comments Download
A third_party/google_benchmark/cmake/AddCXXCompilerFlag.cmake View 1 chunk +64 lines, -0 lines 0 comments Download
A third_party/google_benchmark/cmake/CXXFeatureCheck.cmake View 1 chunk +44 lines, -0 lines 0 comments Download
A third_party/google_benchmark/cmake/Config.cmake.in View 1 chunk +1 line, -0 lines 0 comments Download
A third_party/google_benchmark/cmake/GetGitVersion.cmake View 1 chunk +51 lines, -0 lines 0 comments Download
A third_party/google_benchmark/cmake/gnu_posix_regex.cpp View 1 chunk +12 lines, -0 lines 0 comments Download
A third_party/google_benchmark/cmake/posix_regex.cpp View 1 chunk +14 lines, -0 lines 0 comments Download
A third_party/google_benchmark/cmake/std_regex.cpp View 1 chunk +10 lines, -0 lines 0 comments Download
A third_party/google_benchmark/cmake/steady_clock.cpp View 1 chunk +7 lines, -0 lines 0 comments Download
A third_party/google_benchmark/cmake/thread_safety_attributes.cpp View 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/google_benchmark/docs/tools.md View 1 chunk +59 lines, -0 lines 0 comments Download
A third_party/google_benchmark/include/benchmark/benchmark.h View 1 chunk +21 lines, -0 lines 0 comments Download
A third_party/google_benchmark/include/benchmark/benchmark_api.h View 1 chunk +915 lines, -0 lines 0 comments Download
A third_party/google_benchmark/include/benchmark/macros.h View 1 chunk +66 lines, -0 lines 0 comments Download
A third_party/google_benchmark/include/benchmark/reporter.h View 1 chunk +236 lines, -0 lines 0 comments Download
A third_party/google_benchmark/mingw.py View 1 chunk +320 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/CMakeLists.txt View 1 chunk +75 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/arraysize.h View 1 chunk +33 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/benchmark.cc View 1 chunk +715 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/benchmark_api_internal.h View 1 chunk +46 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/benchmark_register.cc View 1 chunk +453 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/check.h View 1 chunk +79 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/colorprint.h View 1 chunk +33 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/colorprint.cc View 1 chunk +188 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/commandlineflags.h View 1 chunk +79 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/commandlineflags.cc View 1 chunk +218 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/complexity.h View 1 chunk +61 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/complexity.cc View 1 chunk +324 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/console_reporter.cc View 1 chunk +180 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/counter.h View 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/counter.cc View 1 chunk +68 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/csv_reporter.cc View 1 chunk +149 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/cycleclock.h View 1 chunk +172 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/internal_macros.h View 1 chunk +55 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/json_reporter.cc View 1 chunk +168 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/log.h View 1 chunk +73 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/mutex.h View 1 chunk +155 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/re.h View 1 chunk +140 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/reporter.cc View 1 chunk +68 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/sleep.h View 1 chunk +15 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/sleep.cc View 1 chunk +51 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/stat.h View 1 chunk +306 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/string_util.h View 1 chunk +40 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/string_util.cc View 1 chunk +172 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/sysinfo.h View 1 chunk +10 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/sysinfo.cc View 1 chunk +355 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/timers.h View 1 chunk +48 lines, -0 lines 0 comments Download
A third_party/google_benchmark/src/timers.cc View 1 chunk +208 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/CMakeLists.txt View 1 chunk +164 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/basic_test.cc View 1 chunk +99 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/benchmark_test.cc View 1 chunk +240 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/complexity_test.cc View 1 chunk +167 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/cxx03_test.cc View 1 chunk +48 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/diagnostics_test.cc View 1 chunk +64 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/donotoptimize_test.cc View 1 chunk +33 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/filter_test.cc View 1 chunk +104 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/fixture_test.cc View 1 chunk +49 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/map_test.cc View 1 chunk +56 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/multiple_ranges_test.cc View 1 chunk +74 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/options_test.cc View 1 chunk +65 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/output_test.h View 1 chunk +201 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/output_test_helper.cc View 1 chunk +423 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/register_benchmark_test.cc View 1 chunk +148 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/reporter_output_test.cc View 1 chunk +256 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/skip_with_error_test.cc View 1 chunk +150 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/user_counters_tabular_test.cc View 1 chunk +250 lines, -0 lines 0 comments Download
A third_party/google_benchmark/test/user_counters_test.cc View 1 chunk +217 lines, -0 lines 0 comments Download
A third_party/google_benchmark/tools/compare_bench.py View 1 chunk +68 lines, -0 lines 0 comments Download
A third_party/google_benchmark/tools/gbench/Inputs/test1_run1.json View 1 chunk +60 lines, -0 lines 0 comments Download
A third_party/google_benchmark/tools/gbench/Inputs/test1_run2.json View 1 chunk +60 lines, -0 lines 0 comments Download
A third_party/google_benchmark/tools/gbench/__init__.py View 1 chunk +8 lines, -0 lines 0 comments Download
A third_party/google_benchmark/tools/gbench/report.py View 1 chunk +146 lines, -0 lines 0 comments Download
A third_party/google_benchmark/tools/gbench/util.py View 1 chunk +159 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (5 generated)
dyaroshev
Hi! Are you generally OK with adding this library? Even without regular runs, this is ...
3 years, 7 months ago (2017-05-05 23:19:11 UTC) #6
dyaroshev
In third_party I wrote BUILD.gn and README.chromium. Other files are taken as is from library.
3 years, 7 months ago (2017-05-05 23:21:21 UTC) #7
dyaroshev
On 2017/05/05 23:21:21, dyaroshev wrote: > In third_party I wrote BUILD.gn and README.chromium. Other files ...
3 years, 7 months ago (2017-05-09 21:38:22 UTC) #8
jdoerrie
On 2017/05/09 21:38:22, dyaroshev wrote: > On 2017/05/05 23:21:21, dyaroshev wrote: > > In third_party ...
3 years, 7 months ago (2017-05-10 20:40:18 UTC) #9
danakj
On 2017/05/10 20:40:18, jdoerrie (slow this week) wrote: > On 2017/05/09 21:38:22, dyaroshev wrote: > ...
3 years, 7 months ago (2017-05-10 20:45:53 UTC) #10
dyaroshev
On 2017/05/10 20:45:53, danakj wrote: > On 2017/05/10 20:40:18, jdoerrie (slow this week) wrote: > ...
3 years, 7 months ago (2017-05-10 22:06:36 UTC) #11
brettw
See these instructions for adding third_party libraries: https://chromium.googlesource.com/chromium/src.git/+/master/docs/adding_to_third_party.md This is probably not possible for non-Googlers ...
3 years, 7 months ago (2017-05-10 22:36:45 UTC) #12
brettw
It looks like we don't want to add this. Please see: https://groups.google.com/a/chromium.org/d/msg/chromium-dev/PFqPgWLPUQ0/Dy6QEc5sCwAJ for the infra ...
3 years, 7 months ago (2017-05-10 23:11:54 UTC) #13
dyaroshev
On 2017/05/10 23:11:54, brettw (behind--catching up) wrote: > It looks like we don't want to ...
3 years, 7 months ago (2017-05-11 11:29:51 UTC) #14
brettw
On 2017/05/11 11:29:51, dyaroshev wrote: > On 2017/05/10 23:11:54, brettw (behind--catching up) wrote: > > ...
3 years, 7 months ago (2017-05-12 18:08:25 UTC) #15
dyaroshev
3 years, 7 months ago (2017-05-12 18:13:30 UTC) #16
On 2017/05/12 at 18:08:25, brettw wrote:
> This isn't just me, I talked to some others too who have similar opinions. We
do a lot of perf testing, I would check out some of the other infrastructure. If
there are additions we can make to these things that support your use-case
better, we should discuss those.
> 
> This doesn't integrate with our perf testing infrastructure, and the main
problem we have lately is too much complexity rather than specific tasks being
hard. I have found some microbenchmarks useful, but only rarely so. We're
unlikely to start running these tests on the bots, for example, so the benefit
of this doesn't justify adding more complexity to the project.

Ok, I see your point, thanks for considering.

Of course I would make the additions to the infrastructure, if there were easy
enough - unfortunately fighting optimiser and time measuring is not and it
requires too much specific knowledge that I don't have.

I can write benchmarks on a case by case basis, when I need to. It has a few
downsides but doable.

Powered by Google App Engine
This is Rietveld 408576698