tp: massively speed up startup metric

This CL significantly improves the speed of the startup metric which
regressed considerably in the past few months.

We do this in two ways:
(1) Materalize aggregated data which comes from span joined tables or
from unaggreated slice tables. This converts an op which is O(no of
startups * no of slices) to just O(no of startups)
(2) Convert IN clause of process lookup to a JOIN.

Some timings for context on trace from b/187546438:
* Code at ToT: 272s
* Code with last ~6 changes to startup metric: 53s [*]
* Code with this change: 12s

This means the affect of each individual change is
(1) Saving of 219s
(2) Saving of 41s

[*]: This basically measures the affect of change (1) above as the
most recent changes introduced these lookups on unaggreated tables.

Change-Id: I912a7d520cedfa93141ad1f8f8fd4100f35cb2f2
Bug: 187546438
1 file changed
tree: 18b3a14353025900e0011960a17a7b1382a127bf
  1. .github/
  2. bazel/
  3. build_overrides/
  4. buildtools/
  5. debian/
  6. docs/
  7. examples/
  8. gn/
  9. include/
  10. infra/
  11. protos/
  12. src/
  13. test/
  14. tools/
  15. ui/
  16. .clang-format
  17. .clang-tidy
  18. .gitattributes
  19. .gitignore
  20. .gn
  21. .style.yapf
  22. Android.bp
  23. Android.bp.extras
  24. BUILD
  25. BUILD.extras
  26. BUILD.gn
  27. CHANGELOG
  28. codereview.settings
  29. DIR_METADATA
  30. heapprofd.rc
  31. LICENSE
  32. meson.build
  33. METADATA
  34. MODULE_LICENSE_APACHE2
  35. OWNERS
  36. perfetto.rc
  37. PerfettoIntegrationTests.xml
  38. PRESUBMIT.py
  39. README.chromium
  40. README.md
  41. TEST_MAPPING
  42. traced_perf.rc
  43. WORKSPACE
README.md

Perfetto - System profiling, app tracing and trace analysis

Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.

See https://perfetto.dev/docs or the /docs/ directory for documentation.