No description
Find a file
Sebastian Pop 1f93d71022 use std::hash instead of hashing byte by byte
This patch uses libcxx's string_view hashing.  The performance is better than the
current implementation, and almost the same as for the hashing implementation amended
by the patch in https://android-review.googlesource.com/404742

The following experiments were conducted on a HiKey aarch64 A53.

No changes:
$ adb push out/target/product/hikey/data/benchmarktest64/ziparchive-benchmarks /data
$ adb shell /data/ziparchive-benchmarks --benchmark_repetitions=5
-----------------------------------------------------------------
Benchmark                          Time           CPU Iterations
-----------------------------------------------------------------
FindEntry_no_match          82279629 ns   81759676 ns          9
FindEntry_no_match          81648056 ns   81627431 ns          9
FindEntry_no_match          81384074 ns   81369057 ns          9
FindEntry_no_match          89618889 ns   82437755 ns          9
FindEntry_no_match          81811389 ns   81785261 ns          9
FindEntry_no_match_mean     83348407 ns   81795836 ns          9
FindEntry_no_match_stddev    3520421 ns     394962 ns          0
Iterate_all_files          137622000 ns  137589032 ns          5
Iterate_all_files          139666333 ns  138409469 ns          5
Iterate_all_files          150070000 ns  140883697 ns          5
Iterate_all_files          138600667 ns  138540646 ns          5
Iterate_all_files          137599833 ns  137567438 ns          5
Iterate_all_files_mean     140711767 ns  138598056 ns          5
Iterate_all_files_stddev     5299929 ns    1354928 ns          0

$ cd system/core/libziparchive
$ git fetch https://android.googlesource.com/platform/system/core refs/changes/42/404742/7 && git cherry-pick FETCH_HEAD
$ mma
$ cd -
$ adb push out/target/product/hikey/data/benchmarktest64/ziparchive-benchmarks /data
$ adb shell /data/ziparchive-benchmarks --benchmark_repetitions=5
-----------------------------------------------------------------
Benchmark                          Time           CPU Iterations
-----------------------------------------------------------------
FindEntry_no_match          53302756 ns   53291178 ns         13
FindEntry_no_match          54314487 ns   54272272 ns         13
FindEntry_no_match          53866923 ns   53851178 ns         13
FindEntry_no_match          53324423 ns   53317296 ns         13
FindEntry_no_match          53289231 ns   53289159 ns         13
FindEntry_no_match_mean     53619564 ns   53604216 ns         13
FindEntry_no_match_stddev     458449 ns     443527 ns          0
Iterate_all_files          128211111 ns  112254783 ns          6
Iterate_all_files          110695000 ns  110677726 ns          6
Iterate_all_files          109351250 ns  109350998 ns          6
Iterate_all_files          109367500 ns  109367796 ns          6
Iterate_all_files          110872222 ns  110591407 ns          6
Iterate_all_files_mean     113699417 ns  110448542 ns          6
Iterate_all_files_stddev     8143723 ns    1194577 ns          0

$ cd system/core/libziparchive
$ git checkout HEAD~
$ git am 0001-use-std-hash.patch
$ mma
$ cd -
$ adb push out/target/product/hikey/data/benchmarktest64/ziparchive-benchmarks /data
$ adb shell /data/ziparchive-benchmarks --benchmark_repetitions=5
-----------------------------------------------------------------
Benchmark                          Time           CPU Iterations
-----------------------------------------------------------------
FindEntry_no_match          55339872 ns   55195112 ns         13
FindEntry_no_match          56232628 ns   56069924 ns         13
FindEntry_no_match          55694103 ns   55255946 ns         13
FindEntry_no_match          55275064 ns   55120136 ns         13
FindEntry_no_match          54971987 ns   54944411 ns         13
FindEntry_no_match_mean     55502731 ns   55317106 ns         13
FindEntry_no_match_stddev     482032 ns     436766 ns          0
Iterate_all_files          114618611 ns  114487804 ns          6
Iterate_all_files          112552917 ns  112229801 ns          6
Iterate_all_files          111288750 ns  111255044 ns          6
Iterate_all_files          111291528 ns  111259045 ns          6
Iterate_all_files          114347222 ns  113677119 ns          6
Iterate_all_files_mean     112819806 ns  112581763 ns          6
Iterate_all_files_stddev     1606214 ns    1454858 ns          0

Change-Id: I1e3413d331bcb460ca38bc2c87e23f89b456cd2f
2017-11-29 09:44:28 -06:00
adb Merge "Move GetDeviceTest from adb's test_device.py to adb package." 2017-11-09 00:57:32 +00:00
adf libadfhwc: Fix adf_hwc_close 2017-03-02 17:40:16 +00:00
base Use -Werror in system/core 2017-11-01 11:32:55 -07:00
bootstat bootstat: Add another boot reason. 2017-10-31 10:07:34 -07:00
cpio Possible null pointer miss on realloc 2017-03-23 22:41:14 +01:00
debuggerd Merge "crash_dump: don't inherit environment from parent." 2017-11-08 00:44:47 +00:00
demangle Add support for non-virtual thunk. 2017-11-01 16:24:55 -07:00
fastboot Merge "fastboot: handle small flash block sizes correctly" 2017-11-03 21:15:34 +00:00
fs_mgr Merge "fs_mgr: support reading fstab based on ro.boot.hardware.platform" 2017-11-01 20:46:22 +00:00
gatekeeperd resolve merge conflicts of 0dd4b6aa3 to stage-aosp-master 2017-09-15 16:50:34 +09:00
healthd resolve merge conflicts of 796987482 to stage-aosp-master 2017-10-17 12:36:14 -07:00
include Move android_filesystem_config.h => fs_config.h 2017-08-02 16:31:19 -07:00
init Use -Werror in system/core 2017-11-01 11:32:55 -07:00
libappfuse libappfuse: use an explicit buffer size 2017-08-02 14:11:25 -07:00
libasyncio Use -Werror in system/core 2017-11-01 11:32:55 -07:00
libbacktrace Only skip frames for local unwinds. 2017-11-02 16:22:52 -07:00
libbinderwrapper libbinderwrapper: Android.mk -> Android.bp 2017-04-25 15:55:26 -07:00
libcrypto_utils Mark the modules as VNDK in Android.bp 2017-09-14 08:35:16 +00:00
libcutils libcutils: Work around the lack of __mulodi4 2017-11-04 00:36:01 +00:00
libdiskconfig Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]] 2017-10-02 10:44:29 -07:00
libgrallocusage Use -Werror in system/core 2017-11-01 11:32:55 -07:00
libion Merge "libion: Adapt to new ION interface" 2017-09-21 01:06:32 +00:00
libkeyutils Add libkeyutils. 2017-05-10 14:53:28 -07:00
liblog Allow stats buffer to be empty in liblog CTS. 2017-10-25 13:46:42 -07:00
libmemtrack Mark libmemtrack as VNDK in Android.bp 2017-09-14 02:46:36 +00:00
libmemunreachable Silence static analyzer warnings about memory leaks 2017-09-24 13:36:29 -07:00
libmetricslogger libmetricslogger: Fix the out-of-sync proto IDs for boot reason. 2017-10-06 14:30:08 -07:00
libnativebridge Use -Werror in system/core/libnativebridge 2017-10-31 15:55:40 -07:00
libnativeloader Remove default libraries 2017-09-29 13:17:06 -07:00
libnetutils Mark the modules as VNDK in Android.bp 2017-09-14 08:35:16 +00:00
libpackagelistparser Use -Werror in system/core 2017-11-01 11:32:55 -07:00
libpixelflinger MIPS[64]: codeflinger: Fix build due to unused variable warnings 2017-11-06 16:38:49 +01:00
libprocessgroup Add memcg related configs to init. 2017-07-18 15:58:40 -07:00
libprocinfo Use -Werror in system/core 2017-11-01 11:32:55 -07:00
libsparse Merge "<stdbool.h> not necessary in C++." 2017-10-17 19:26:53 +00:00
libsuspend Merge "Mark the modules as VNDK in Android.bp" 2017-09-15 16:31:01 +00:00
libsync Merge "libsync: Add fence info tests" 2017-09-26 23:46:32 +00:00
libsystem fix circular dependency libnativewindow <-> libui 2017-05-09 15:15:50 -07:00
libsysutils Stop depending on libnl. 2017-10-05 14:56:44 +09:00
libunwindstack Fix another nullptr dereference. 2017-11-08 11:04:48 -08:00
libusbhost Mark the modules as VNDK in Android.bp 2017-09-14 08:35:16 +00:00
libutils Use -Werror in system/core 2017-11-01 11:32:55 -07:00
libvndksupport Make libvndksupport look for default namespace as well. 2017-11-09 18:07:47 -08:00
libziparchive use std::hash instead of hashing byte by byte 2017-11-29 09:44:28 -06:00
lmkd lmkd: Android.mk -> Android.bp 2017-04-28 15:20:18 -07:00
logcat logcat: Note in help that regexps are Perl-compatible 2017-10-31 12:44:54 +00:00
logd Buffer overrun in __android_log_is_loggable() fix 2017-11-07 09:57:26 -08:00
logwrapper Merge "logwrapper: add a benchmark for android_fork_execvp_ext" 2017-03-23 11:56:10 +00:00
mkbootimg mkbootimg: use int for os_version and os_patch_level 2016-03-29 16:06:37 -07:00
qemu_pipe Mark libqemu_pipe vendor_available 2017-06-08 14:16:11 -07:00
reboot reboot: only pause indefinitely for non-shutdown operations 2017-09-29 16:29:52 +00:00
rootdir Tests are run with proper namespace configs by their locations 2017-10-30 10:27:45 +09:00
run-as run-as: Keep supplementary groups. 2017-09-29 15:34:23 -04:00
sdcard Revert "Add derive_gid flag for mounting sdcardfs" 2017-09-22 09:03:18 -07:00
shell_and_utilities Update shell and utilities docs for O. 2017-09-13 20:59:25 -07:00
storaged storaged: stop binder threads before exiting 2017-04-04 19:44:01 +00:00
toolbox Revert "delete toolbox/r.c" 2017-11-02 10:03:10 -05:00
trusty Use -Werror in system/core 2017-11-01 11:32:55 -07:00
.clang-format Add a 2 width option of clang format. 2017-03-10 13:01:39 -08:00
.clang-format-2 Only allow short functions in class definitions. 2017-03-28 12:31:37 -07:00
.clang-format-4 Only allow short functions in class definitions. 2017-03-28 12:31:37 -07:00
.gitignore Ignore adb/*.pyc files 2015-08-11 12:59:58 -07:00
Android.bp Export android_filesystem_config.h as a filegroup 2017-01-17 18:20:28 -08:00
Android.mk Remove the simulator target from all makefiles. 2011-07-11 22:12:32 -07:00
CleanSpec.mk Removing $(PRODUCT_OUT)/root/root 2017-09-28 18:10:58 +08:00
MODULE_LICENSE_APACHE2 auto import from //depot/cupcake/@135843 2013-07-30 13:56:49 -07:00
NOTICE Fix omission in NOTICE file. 2013-07-30 13:56:55 -07:00
platform_tools_tool_version.mk Fix warning on the build servers 2017-05-25 12:35:40 -07:00
PREUPLOAD.cfg Add a PREUPLOAD.cfg file to run git-clang-format on every commit 2017-03-08 16:51:26 +08:00