add a performance benchmark for libziparchive

This patch adds two benchmarks that measure the performance of some
operations of libziparchive.

Both benchmarks are creating a temporary zip file containing file
names of uniformly distributed lengths.  The creation of the zip
file is not timed in the benchmarks.

- FindEntry_no_match tries to find an inexisting entry in the files
  of the zip archive, in order to force the code to examine all the
  files in the archive.

- Iterate_all_files uses the iterate function to list all the files
  in the archive.

Bug: N/A
Test: adb shell /data/ziparchive-benchmarks
Change-Id: Ibdb524ba1c5ae55caddf0416ebbc09f8b6df0021
diff --git a/libziparchive/Android.bp b/libziparchive/Android.bp
index 44daf36..9f53198 100644
--- a/libziparchive/Android.bp
+++ b/libziparchive/Android.bp
@@ -122,3 +122,29 @@
         },
     },
 }
+
+// Performance benchmarks.
+cc_benchmark {
+    name: "ziparchive-benchmarks",
+    defaults: ["libziparchive_flags"],
+
+    srcs: [
+        "zip_archive_benchmark.cpp",
+    ],
+    shared_libs: [
+        "libbase",
+        "liblog",
+    ],
+
+    static_libs: [
+        "libziparchive",
+        "libz",
+        "libutils",
+    ],
+
+    target: {
+        host: {
+            cppflags: ["-Wno-unnamed-type-template-args"],
+        },
+    },
+}