init.rc: Disable native stats collection service
When opening and closing activities in Settings, a measurably
significant amount of CPU time is spent processing and logging stats
events in statsd:
0.02% /apex/com.android.os.statsd/lib64/libstatspull.so @plt
0.01% /apex/com.android.os.statsd/bin/statsd @plt
0.01% /apex/com.android.os.statsd/bin/statsd SocketListener::runListener()
0.01% /apex/com.android.os.statsd/bin/statsd android::os::statsd::LogEvent::parseBuffer(unsigned char*, unsigned long)
0.01% /apex/com.android.os.statsd/bin/statsd android::os::statsd::LogEvent::parseAnnotations(unsigned char, int)
Over longer device uptimes with real-world usage, statsd uses a
substantial amount of total CPU time. We have no use for the stats
recorded by statsd, so disable the service entirely to save CPU in
potential hotpaths.
This is the system/core part of the change; changes to frameworks/base
are also required.
Test: simpleperf record -a; verify that statsd no longer appears in
sample hits
Change-Id: Idf6fdb0eff987169bd5f370dd72315e831a669e6
1 file changed