diff options
author | Mark Salyzyn <salyzyn@google.com> | 2015-10-02 10:00:38 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-11-01 04:29:13 -0800 |
commit | 626d8a42a1fc02d18598f9a59903e5b58549502a (patch) | |
tree | 79c836667f8c7be7f6a7012ee34a8a4cd7a91d38 | |
parent | 75e80775d98d1d6e4fd3e6f3a8059a23413e031e (diff) | |
download | system_core-626d8a42a1fc02d18598f9a59903e5b58549502a.zip system_core-626d8a42a1fc02d18598f9a59903e5b58549502a.tar.gz system_core-626d8a42a1fc02d18598f9a59903e5b58549502a.tar.bz2 |
liblog: optimize code hotspot
strcmp was 1/10 #2 behind find_property in __android_log_level(),
now virtually eliminated from performance profile.
Bug: 23685592
Change-Id: I3978886193af77e489c6d1728d6a26b7f53f8f2f
-rw-r--r-- | liblog/log_is_loggable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/liblog/log_is_loggable.c b/liblog/log_is_loggable.c index 7a8e33f..cd85ff6 100644 --- a/liblog/log_is_loggable.c +++ b/liblog/log_is_loggable.c @@ -93,7 +93,7 @@ static int __android_log_level(const char *tag, int def) if (taglen) { uint32_t current_local_serial = current_global_serial; - if (!last_tag || strcmp(last_tag, tag)) { + if (!last_tag || (last_tag[0] != tag[0]) || strcmp(last_tag + 1, tag + 1)) { /* invalidate log.tag.<tag> cache */ for(i = 0; i < (sizeof(tag_cache) / sizeof(tag_cache[0])); ++i) { tag_cache[i].pinfo = NULL; |