From c9fd9263feedac32e4f5b1f13a3246347efdc25f Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Fri, 16 Mar 2012 19:25:20 -0700 Subject: Use quicksort to sort the string pool. The current implementation of Vector::sort uses insertion sort on the assumption that the data is mostly sorted. It isn't. This change brings the total time spent sorting packages by config down to 500ms from about 93 seconds. Bug: 6186278 Change-Id: Iec8da11e09297acd6c73733d063b0fa9dacf69f7 --- tools/aapt/StringPool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/aapt/StringPool.h') diff --git a/tools/aapt/StringPool.h b/tools/aapt/StringPool.h index 060dc68..d501008 100644 --- a/tools/aapt/StringPool.h +++ b/tools/aapt/StringPool.h @@ -139,7 +139,7 @@ public: const Vector* offsetsForString(const String16& val) const; private: - static int config_sort(const size_t* lhs, const size_t* rhs, void* state); + static int config_sort(void* state, const void* lhs, const void* rhs); const bool mUTF8; -- cgit v1.1