Commit Graph

13 Commits

Author SHA1 Message Date
Michael Lippautz
5ab4b89e12 cppgc: Add binary trees benchmark
Change-Id: I4886923bd3b2c29f5f317fbfab078af4d5dd8510
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289156
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77981}
2021-11-18 16:42:24 +00:00
Michael Lippautz
3eae9d57ef cppgc: Initialize benchmark process only once
Otherwise, DCHECKs complain that the PageAllocator used for the
GlobalGCInfoTable may differ when setting up the platform repeatedly
through benchmarking SetUp().

Change-Id: I7e87e8c9d8c283105e1bd75a4cd176df7f304315
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283075
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77920}
2021-11-16 13:15:44 +00:00
Dan Elphick
e3d63e962f [build] Fix gn check errors in test/benchmarks/cpp
Expose third_party/google_benchmark:google_benchmark as a public dep
from third_party/google_benchmark:benchmark_main and a v8_libbase
dependency to empty_benchmark to expose base/macros.h.

Bug: v8:7330
Change-Id: I5205af365da2ac7c35647acff90ed65d831cfa07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2851888
Commit-Queue: Dan Elphick <delphick@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74217}
2021-04-27 10:35:33 +00:00
Michael Lippautz
707c5a0b38 cppgc: Fix empty benchmark on Windows
Keep idiomatic state loop but rely on USE() to avoid
warning about unused variables.

Bug: v8:11687
Change-Id: Icde295723c5d389d827280f70a65776866d4e7a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2850645
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74200}
2021-04-27 07:52:52 +00:00
Almothana Athamneh
4a9810d85f Make Google benchmark dependency a default
Bug: v8:11639
Change-Id: I3352261c5593c33154aa8f1a931bf3ee351f536a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2831487
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74098}
2021-04-21 12:19:40 +00:00
Michael Lippautz
224b7f079c cppgc: Fix trace performance benchmark
Bug: v8:11635
Change-Id: I71c5542a503ca4b94fc3c8746e96fb0bc4e6c1f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2822628
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73922}
2021-04-12 19:31:33 +00:00
Chris Mumford
84d2527bb0 IWYU: Added missing include: include/cppgc/persistent.h
This missing include was undetected because trace_perf.cc is only
built if the checkout_google_benchmark custom gclient variable is
defined.

Bug: none
Change-Id: If2016edad4df382f14903593ea18066f7759c4d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2698387
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Chris Mumford <cmumford@google.com>
Cr-Commit-Position: refs/heads/master@{#72825}
2021-02-17 17:37:29 +00:00
Michael Lippautz
a2cf158ad4 cppgc-js: Report C++ memory to V8's heap growing
Add reporting of C++ memory to V8's heap growing strategy via
existing EmbedderHeapTracer interface.

In addition, introduce API-level NoGarbageCollectionScope which
allows to temporarily avoid scheduling GC finalizations. Replace
internal NoGCScope with NoGarbageCollectionScope and remove
NoGCScope.

Bug: chromium:1056170
Change-Id: I0ad3dfd67eb81f09f48e2ab87f9bbece7491ed71
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2650210
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72345}
2021-01-27 00:32:05 +00:00
Omer Katz
0e0d1b0d7c cppgc: Fix cppgc build
The CPPGC_BUILD_IN_V8 define (used for tracing) isn't propagated from
v8_base_without_compiler to cppgc_base, which breaks build with
perfetto. Instead use a gn args to specify standalone builds (defaulted
to false) and use that to choose the right tracing implementation.

Bug: chromium:1056170
Change-Id: I70bce819d45fb133b6f932a50a5d027e39f3e5b9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2555007
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71356}
2020-11-24 09:35:50 +00:00
Omer Katz
ab2b18e1be cppgc: Use object start bitmap to trace mixins
This CL removes the GetTraceDescriptor virtual call from garbage
collected mixins and replaces it with querying the object start
bitmap.

The CL also removes the mixin macros which are now no longer needed.

Bug: chromium:1056170
Change-Id: I27ed299f93025d09a3bb3f0d17b14bed3c200565
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287508
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68787}
2020-07-10 12:00:45 +00:00
Michael Lippautz
5ab2769012 cppgc: Add micro benchmark for tracing objects
The benchmarks cover static vs dynamic tracing of an object where the
header is computed statically vs using the object start bitmap,
respectively.

$ out/x64.release/cppgc_basic_benchmarks --benchmark_filter=Trace/*

Running out/x64.release/cppgc_basic_benchmarks
Run on (56 X 3500 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x28)
  L1 Instruction 32 KiB (x28)
  L2 Unified 256 KiB (x28)
  L3 Unified 35840 KiB (x2)
Load Average: 0.24, 0.26, 0.26
--------------------------------------------------------
Benchmark              Time             CPU   Iterations
--------------------------------------------------------
Trace/Static        1.78 ns         1.78 ns    393324147
Trace/Dynamic       3.27 ns         3.27 ns    215078276

2020-07-03T15: 21:25+02:00
Change-Id: I8bf5a8ed71a8991873160353e26f96214c038730
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2280099
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68675}
2020-07-03 14:50:43 +00:00
Michael Lippautz
66fc94313b cppgc: Add allocation benchmark
Output:

$ out/x64.release/cppgc_allocation_benchmark --benchmark_repetitions=3

Running out/x64.release/cppgc_allocation_benchmark
Run on (56 X 3500 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x28)
  L1 Instruction 32 KiB (x28)
  L2 Unified 256 KiB (x28)
  L3 Unified 35840 KiB (x2)
Load Average: 0.23, 0.27, 0.27
--------------------------------------------------------------------------------
Benchmark                      Time             CPU   Iterations UserCounters...
--------------------------------------------------------------------------------
Allocate/Tiny               17.0 ns         17.0 ns     40348381 bytes_per_second=55.9692M/s
Allocate/Tiny               17.1 ns         17.1 ns     40348381 bytes_per_second=55.8961M/s
Allocate/Tiny               17.2 ns         17.2 ns     40348381 bytes_per_second=55.3108M/s
Allocate/Tiny_mean          17.1 ns         17.1 ns            3 bytes_per_second=55.7254M/s
Allocate/Tiny_median        17.1 ns         17.1 ns            3 bytes_per_second=55.8961M/s
Allocate/Tiny_stddev       0.112 ns        0.111 ns            3 bytes_per_second=369.571k/s
Allocate/Large             40339 ns        40334 ns        17707 bytes_per_second=1.51326G/s
Allocate/Large             40350 ns        40343 ns        17707 bytes_per_second=1.51292G/s
Allocate/Large             40205 ns        40192 ns        17707 bytes_per_second=1.51861G/s
Allocate/Large_mean        40298 ns        40290 ns            3 bytes_per_second=1.51493G/s
Allocate/Large_median      40339 ns        40334 ns            3 bytes_per_second=1.51326G/s
Allocate/Large_stddev       81.2 ns         84.7 ns            3 bytes_per_second=3.26614M/s

2020-07-03T09: 14:23+02:00
Change-Id: I25a55beb5ea1718af76e638b752bf7d67cfe373e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2280086
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68672}
2020-07-03 11:58:21 +00:00
Michael Lippautz
b804266f72 Add google_benchmark depdendency
This adds Google benchmark for microbenchmarking C++ code as an
optional dependency.

To enable, add the following to the .gclient before syncing
  "custom_vars": {
      "checkout_google_benchmark": True
  }

Change-Id: Id0eab772dd71558906658ef4bb60e31acd665948
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2275964
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68663}
2020-07-02 20:11:29 +00:00