commit | 0c2eb75ed7627eec3ece22ff16857fb9fd7b65cd | [log] [tgz] |
---|---|---|
author | Miguel Flores Ruiz de Eguino <miguelfrde@google.com> | Wed Jan 11 13:21:53 2023 +0000 |
committer | releases-try-builder <releases-try-builder@fuchsia-infra.iam.gserviceaccount.com> | Wed Feb 08 03:56:27 2023 +0000 |
tree | 00b60699aca9006d74fac90cd8baba3247efe2ae | |
parent | 3a2b5fea46a0a2bfd2299a5147b923b86461440e [diff] |
[hierarchy][fixes] Squash two diagnostics optimizations First optimization: [hierarchy] Remove usage of regexes in select_from_hierarchy `select_from_hierarchy` was previously executing a `filter_hierarchy`. In the case of Sampler, this wasn't necessary since Sampler receives hierarchies that have been filtered by the Archivist. In the case of triage, there's no need to filter the whole hierarchy and then collect the properties into a vector, we can instead get the properties as we traverse the hierarchy in a DFS way. This still doesn't remove usage of RegexSet in the Archivist but it does for Sampler. Additionally the new implementation removes cloning of data and returns the selected properties in a hierarchy as references to the original hierarchy. There's some cloning still in triage that might be possible to optimize into dealing with references, but that's out of scope of this CL as Sampler is the main target. This refactor brings back ~300K in Sampler: https://screenshot.googleplex.com/WXqGbYVzNzV5FwN.png. Bug: 117157 Run-All-Tests: True Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/777862 Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com> Reviewed-by: Christopher Johnson <crjohns@google.com> Fuchsia-Auto-Submit: Miguel Flores <miguelfrde@google.com> Second optimization: [hierarchy] Remove regex sets and cloning from filter_hierarchy filter_hierarchy is no longer implemented using regexes. Additionally, it now performs filtering of the input hierarchy in-place instead of copying the data over to a new result hierarchy. Together with fxrev.dev/779483 and fxrev.dev/777862 I see the following improved memory usage in archivist: https://screenshot.googleplex.com/C8DVzCVQHo9Womm.png This also improves the SnapshotAndSelect benchmarks significantly: ``` fuchsia.rust_inspect.selectors: SnapshotAndSelect/10 faster 0.048-0.049 517522 +/- 4446 ns 25148 +/- 174 ns fuchsia.rust_inspect.selectors: SnapshotAndSelect/100 faster 0.054-0.055 123560 +/- 864 ns 6739 +/- 69 ns fuchsia.rust_inspect.selectors: SnapshotAndSelect/1000 faster 0.049-0.051 183722 +/- 1524 ns 9245 +/- 98 ns fuchsia.rust_inspect.selectors: SnapshotAndSelect/10000 faster 0.048-0.049 242915 +/- 1270 ns 11695 +/- 32 ns fuchsia.rust_inspect.selectors: SnapshotAndSelect/100000 faster 0.048-0.049 271898 +/- 1749 ns 13254 +/- 65 ns ``` Run-All-Tests: True Bug: 117157 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/776883 Reviewed-by: Christopher Johnson <crjohns@google.com> Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com> Fuchsia-Auto-Submit: Miguel Flores <miguelfrde@google.com> Change-Id: Ife0f98a6f3c6d5aa81e39b379e30273926135f00
Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.
We expect everyone interacting with our project to respect our code of conduct.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.