summaryrefslogtreecommitdiff
path: root/libs/androidfw/FileStream.cpp
diff options
context:
space:
mode:
author Zimuzo Ezeozue <zezeozue@google.com> 2025-02-10 13:47:08 +0000
committer Zimuzo Ezeozue <zezeozue@google.com> 2025-02-20 13:01:07 +0000
commit8601e96a915b48ecb0d6e395c23ac969a5065fa3 (patch)
treebd5afc1d0a09a77b37790ff87e48440e8d995bce /libs/androidfw/FileStream.cpp
parent6b3d33e24ae86cb283670f590e4290d3ed71ebc6 (diff)
Remove unnecessary interface from Perfetto APIs
1. Removed the Builder interfaces from PerfettoTrackEventExtra to improve performance. The interface was needed for a NoOp impl when tracing was disabled. Instead, we just store a boolean in the builder impl representing whether the category is enabled or not, all the builder methods return early if false. This saves an additional dependent load instruction and an adrp + ldr sequence. This improves the benchmark by a few nanos which adds up for each builder method executed. 2. Moved the check* calls behind a DEBUG flag. This elided the function calls entirely which were also getting inlined and likely spilling the instruction cache. It's a debugging check when generating protos. Besides, proto generation code is likely to change in coming cls. 3. Added a setFlow/setTerminatingFlow call. This limits flows that can be added to an event to at most 1 flow and terminating flow. This is the most common case in practice anyways and we can avoid the expensive indirection to get a flow via the Pool class. godbolt playground to analyze the generated dex2oat code: https://godbolt.org/z/Er9Gjvhfd In a follow up, I'll remove addFlow/addTerminatingFlow Test: atest PerfettoTest Test: atest TracePerfTest Bug: 303199244 Flag: android.os.perfetto_sdk_tracing_v2 Change-Id: I38f9853567734425ef8721dbbd93df8d83d7e257
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions