OSDN Git Service

Improve ProfileSaver to cache data and do minimal I/O
authorCalin Juravle <calin@google.com>
Fri, 18 Mar 2016 16:23:40 +0000 (16:23 +0000)
committerCalin Juravle <calin@google.com>
Fri, 22 Apr 2016 15:10:41 +0000 (16:10 +0100)
commit6726546bf3fd6bdb96a34197119d210bccda7e01
treea3ef34066efd223c91dd5281932e3dbe88274385
parentb9c1b9bdd7689c0e80c64c371581f99e53749e05
Improve ProfileSaver to cache data and do minimal I/O

This CLs introducing caching to further optimize the I/O performed by
the ProfileSaver. The cache stats are also recorded.

Resolved classes are captured and cached after 2 seconds but written
later during application lifetime.

Methods are also cached and the write got smarter to avoid
reading/writing them if it's not needed.

On non scientific experiments the size of the cache reaches just a few
hundreds uint16_t values kept in set, so its impact is minimal.

In terms of how much data we write. In the same non scientific
experiments this reduces the total bytes written by at least 2-3x. In
the first few minutes of after the boot gmscore writes ~3KB (down from
9kb) and quicksearchlauncher writes ~20KB (down from 40KB).

Bug: 27600652

(cherry picked from commit 85f7bf3bbfa17d65ff77e3e826b5f7aff45838a9)

Change-Id: I6ecb04ce81b281d1c1538060dbbaeeeb08906775
profman/profile_assistant.cc
profman/profile_assistant_test.cc
runtime/jit/offline_profiling_info.cc
runtime/jit/offline_profiling_info.h
runtime/jit/profile_compilation_info_test.cc
runtime/jit/profile_saver.cc
runtime/jit/profile_saver.h