From 85f7bf3bbfa17d65ff77e3e826b5f7aff45838a9 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Fri, 18 Mar 2016 16:23:40 +0000 Subject: 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 Change-Id: I3a4e7051ccf04ac8fbd5896d328692db773e979d --- profman/profile_assistant.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profman/profile_assistant.cc') diff --git a/profman/profile_assistant.cc b/profman/profile_assistant.cc index 58e8a3a7d1..ac1865785e 100644 --- a/profman/profile_assistant.cc +++ b/profman/profile_assistant.cc @@ -54,7 +54,7 @@ ProfileAssistant::ProcessingResult ProfileAssistant::ProcessProfilesInternal( for (size_t i = 0; i < new_info.size(); i++) { // Merge all data into a single object. - if (!info.Load(new_info[i])) { + if (!info.MergeWith(new_info[i])) { LOG(WARNING) << "Could not merge profile data at index " << i; return kErrorBadProfiles; } -- cgit v1.2.3-59-g8ed1b