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
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 @@
const Vector<size_t>* 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;