History log of /libcore/luni/src/main/java/java/util/regex/Splitter.java
Revision Date Author Comments
76932ea58323be0b875914396f83aa12bf3229f2 07-Jan-2013 Vladimir Marko <vmarko@google.com> Use EmptyArray.STRING in Splitter.fastSplit().

This is a minor cleanup after
https://android-review.googlesource.com/47964

Change-Id: Id8de6c09f3397b044082c275095ff7a7a43185f9
fc28f29b0b7e6e295c8680a7e1b89e2d26fe61a7 13-Dec-2012 Vladimir Marko <vmarko@google.com> Performance improvement in DiskLruCache.readJournalLine().

Speed up DiskLruCache.readJournalLine() by avoiding memory
allocations from String.split(). For non-CLEAN lines, we
avoid using String.split() altogether and find separators
explicitly, for CLEAN lines we defer to String.split() and
we optimize the underlying Splitter.fastSplit() overload to
avoid unnecessary allocations itself.

On a test journal with 7347 entries (1099 CLEAN) this saves
about 45-50% from ~250ms. On a test journal with 272 entries
(86 CLEAN) this saves about 35-40% from ~10ms. Measured
loadJournal on GN in a tight loop (file contents cached).

If used without the other DiskLruCache.readJournalLine()
improvements, the Splitter.fastSplit() optimization alone
would provide about 60% of the savings. It should also
speed up other code outside the DiskLruCache.

Change-Id: I1d6c6b13d54d8fcba3081f2bb9df701b58f5e143
cec4dd4b1d33f78997603d0f89c0d0e56e64dbcd 26-Apr-2010 Peter Hallam <peterhal@google.com> merge more modules into luni