diff options
author | Dmitri Plotnikov <dplotnikov@google.com> | 2020-09-17 20:49:05 -0700 |
---|---|---|
committer | Dmitri Plotnikov <dplotnikov@google.com> | 2020-09-28 15:32:42 -0700 |
commit | 2237efed886aba9b4771e78a79a4bcca9ce0ed91 (patch) | |
tree | f902aa89dca141bf9cfc4115382b0dff59f3f120 /rs/java/android/renderscript/ProgramVertexFixedFunction.java | |
parent | f9438b04864ebd358a56380c41d86e3179ba17b6 (diff) |
Optimize getting time_in_state for threads of system server
Prior to this change, we would iterate over _all_ UIDs in
the system, select the one for SystemServer and then iterate over
_all_ threads in _all_ processes running under that UID.
This iteration involves reading many directories in /proc and
many files in those directories.
In the new implementation, we only read time_in_state for the
threads in the system server process itself, identifying them by
the PID. This optimization reduces the cost 5:1 to 8:1 in terms
of CPU time, number of files read and amount of RAM used.
Bug: 167994570
Bug: 163063901
Test: atest FrameworksCoreTests:com.android.internal.os.SystemServerCpuThreadReaderTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Test: atest FrameworksCoreTests:com.android.internal.os.KernelSingleProcessCpuThreadReaderTest
Change-Id: Iaa2eabc9f39999b2867bbffbac93b282cde74165
Diffstat (limited to 'rs/java/android/renderscript/ProgramVertexFixedFunction.java')
0 files changed, 0 insertions, 0 deletions