summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Junyu Lai <junyulai@google.com> 2024-08-19 21:57:21 +0800
committer Junyu Lai <junyulai@google.com> 2024-08-23 15:23:49 +0800
commit6899baf09c684c34586333319a5a2380ec512d3f (patch)
tree45fbe6a2d0d28eae522327878b2fc3dd2f2b31dc /libs/androidfw/StringPool.cpp
parent930130ca03f9ac2ffe5aa3a9253992572a45d391 (diff)
Use new NetworkStats#addEntries API
Currently, NetworkStats#addEntry creates a new instance containing the requested result instead of mutating the original object. This creates a heavy memory footprint when the caller invokes it in a loop because a new NetworkStats instance is created whenever an addEntry is called. This is a no-op change except it utilizes the newly created API to add a list of entries at once. This approach only clones the instance once, thereby reducing the required memory footprint. Test: atest CtsStatsdAtomHostTestCases:android.cts.statsdatom.net.BytesTransferredTest Test: adb shell cmd stats pull-source 10000 Test: atest FrameworksServicesTests:com.android.server.stats.pull.netstats.NetworkStatsUtilsTest Flag: com.android.server.stats.netstats_use_add_entries Bug: 335680025 Change-Id: I1b8195d1cacc53e6dc77f154ac1a8108a0220c5b
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions