Go to file
Kevin Lubick e25e4dc7e7 [bazel] Specify files required for the toolchain more precisely.
This improves performance with sandboxing.

One can have Bazel output performance data [1][2], which can be
viewed via chrome://tracing or https://ui.perfetto.dev/.

With Perfetto, the following SQL queries [3][4] can summarize
the sandboxing metrics, as well as the actual compilation
time. http://screen/5TxbeZTso4gNDfD
Note that the dur column is in nanoseconds, so we convert
to seconds. These numbers could further be divided by
the number of processes (in my case 48) to get a scaled output.

SELECT SUM(dur) / 1000000000.0 FROM slice WHERE name = "sandbox.createFileSystem";
SELECT SUM(dur) / 1000000000.0 FROM slice WHERE name = "sandbox.delete";
SELECT SUM(dur) / 1000000000.0 FROM slice WHERE name = "subprocess.run";

I benchmarked the local compilation of //:skia_public using
--config=clang_linux (our custom Linux toolchain). I was
sure to clear the Bazel cache before each run and not count
the time to download/update a toolchain for the first time.

The control measurements (without this CL) are:
  Wall Time = 272.2s
  sandbox.createFileSystem = 5466.9s
  subprocess.run = 2961.0s
  sandbox.delete = 4112.3s

With this CL:
  Wall Time = 53.9s (5.05x faster)
  sandbox.createFileSystem = 403.4s
  subprocess.run = 1610.3s
  sandbox.delete = 348.8s

The control measurement is a touch misleading. Due to it being
so slow, I had recommended developers use a ramdisk when building
on machines with sufficient RAM via the Bazel flag
--sandbox_base=/dev/shm

Here is the control measurement when using a RAM disk:
  Wall Time = 21.2s
  sandbox.createFileSystem = 58.9s
  subprocess.run = 705.1s
  sandbox.delete = 46.6s

With this CL and a RAM disk:
  Wall Time = 19.2s (10% faster)
  sandbox.createFileSystem = 21.8s
  subprocess.run = 722.9s
  sandbox.delete = 16.2s

For devs who cannot or are not using a RAM disk, this is
a huge win. With a RAM disk, it's a modest improvement.

On an RBE build, this had minimal impact. I did my best
to bust the action cache with a fake define and the before
and after times were about the same.

This was inspired by [5] and [6].

[1] Add --profile=/tmp/profile.gz to any command
[2] https://bazel.build/rules/performance#performance-profiling
[3] https://perfetto.dev/docs/quickstart/trace-analysis#sample-queries
[4] https://perfetto.dev/docs/analysis/sql-tables#slice
[5] 93f21c9ef3
[6] 311acff345
Change-Id: Iceb2606e86111159141a286d01fc002d09fe3fe4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/547822
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2022-06-09 11:58:45 +00:00
bazel Manual Dawn Roll 2022-06-08 18:17:28 +00:00
bench Implement onSetLabel method. 2022-06-08 18:43:34 +00:00
bin Update SKPs documentation link 2022-05-18 15:21:44 +00:00
build/fuchsia [fuchsia] Fix fidlc command. 2020-06-10 03:29:24 +00:00
build_overrides Set dawn_vulkan_tools_dir in Dawn's GN overrides 2022-04-14 17:05:33 +00:00
client_utils/android Revert "Move SkCamera.h to client_utils/android" 2022-04-25 12:33:01 +00:00
demos.skia.org [canvaskit] Add in fillText to spreadsheet demo for comparison 2022-02-15 15:35:43 +00:00
dm [dm] Upload old SKPs into a separate "old-skp" Gold corpus. 2022-06-08 18:53:13 +00:00
docker Force removal of broken symlink that ships with Perfetto 2022-05-25 21:27:30 +00:00
docs/examples Reland "Add kR8_unorm_SkColorType" 2022-02-10 18:00:19 +00:00
example [bazel] Add "skia_internal" target that exposes private API for tests/tools. 2022-06-02 11:23:50 +00:00
experimental [bazel] Add "skia_internal" target that exposes private API for tests/tools. 2022-06-02 11:23:50 +00:00
fuzz Run SkSL unit tests with optimizations disabled. 2022-05-11 14:38:07 +00:00
gm Remove GrShaderCaps accessor functions. 2022-06-07 21:08:03 +00:00
gn Add missing header to gni file. 2022-06-07 20:57:16 +00:00
include [includes] Apply include-what-you-use to sksl/ 2022-06-06 13:49:27 +00:00
infra [codesize] Use hours and UTC in GCS file names 2022-06-08 19:05:43 +00:00
modules [skottie] Text animator support for stroke width 2022-06-07 21:02:48 +00:00
platform_tools Fix bug where SkQP test that are always to be excluded are not. 2022-04-29 20:26:54 +00:00
resources [skottie] Text animator support for stroke width 2022-06-07 21:02:48 +00:00
samplecode Remove GrShaderCaps accessor functions. 2022-06-07 21:08:03 +00:00
site [bazel] Delete gazelle-based BUILD.bazel files 2022-05-31 14:14:54 +00:00
specs [infra] Port serve.py from Python2 to 3 2021-08-31 15:28:19 +00:00
src [graphite] Add the combination system's BeginBlock usages 2022-06-08 20:08:12 +00:00
tests Implement onSetLabel method. 2022-06-08 18:43:34 +00:00
third_party Allow buildroot to specify location of vulkan_memory_allocator 2022-06-06 15:28:09 +00:00
toolchain [bazel] Specify files required for the toolchain more precisely. 2022-06-09 11:58:45 +00:00
tools Implement onSetLabel method. 2022-06-08 18:43:34 +00:00
.bazelrc [bazel] Add in hierarchical filegroup Bazel rules. 2022-05-31 14:14:54 +00:00
.bazelversion [canvaskit] Add skottie to Bazel build 2022-02-04 19:18:27 +00:00
.clang-format no more bin packing in .clang-format 2021-03-04 17:22:50 +00:00
.clang-tidy Disable ClangTidy namespace comments for short blocks. 2020-08-24 14:01:22 +00:00
.gitignore [infra] Add BazelBuild task to build CanvasKit on the CI with Bazel 2022-05-06 17:54:08 +00:00
.gn Add support for ANGLE's Metal backend 2022-04-28 19:53:18 +00:00
.vpython [python3] Reland recipes -> python3 changes 2021-12-01 13:04:03 +00:00
AUTHORS Add mike@reedtribe.org to AUTHORS 2022-05-19 12:49:11 +00:00
BUILD.bazel [bazel] Add "skia_internal" target that exposes private API for tests/tools. 2022-06-02 11:23:50 +00:00
BUILD.gn Revert "Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class" 2022-05-26 16:21:27 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Roll ANGLE from 4ea62009c99b to 48b928d98fc8 (5 revisions) 2022-06-09 05:51:47 +00:00
DIR_METADATA Move metadata in OWNERS files to DIR_METADATA files 2021-02-02 23:41:54 +00:00
go_repositories.bzl [infra] Update dep of infra repo 2022-04-28 13:20:10 +00:00
go.mod [infra] Update dep of infra repo 2022-04-28 13:20:10 +00:00
go.sum [infra] Fix go.sum 2022-04-28 18:01:34 +00:00
LICENSE LICENSE file: clean up 2019-11-22 21:59:03 +00:00
OWNERS [infra] Add wildcard OWNERS 2021-08-30 19:19:34 +00:00
OWNERS.android Update OWNERS.android with more details 2022-03-16 18:13:33 +00:00
package-lock.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
package.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
PRESUBMIT.py [bazel] Add Presubmit exception for public.bzl 2022-06-02 19:45:05 +00:00
public.bzl Migrate Analysis::IsTrivialExpression to its own cpp. 2022-06-02 20:39:08 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
RELEASE_NOTES.txt Add SkSurfaceProps parameter to several APIs 2022-06-02 13:12:33 +00:00
requirements.txt Added expected hash for MarkupSafe for the MacOS platform with the M1 chip 2022-05-19 17:54:32 +00:00
whitespace.txt Push shaders.skia.org. 2022-01-19 21:46:16 +00:00
WORKSPACE.bazel [bazel] Move remaining codec build rules to //bazel/external 2022-06-01 19:12:14 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.