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
This commit is contained in:
Jeff Brown
2012-03-16 19:25:20 -07:00
parent 61361f376b
commit c9fd9263fe
2 changed files with 10 additions and 6 deletions

View File

@ -139,7 +139,7 @@ public:
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;