| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now I see what jessewilson was trying to say earlier; rewrite the post-loop
code to say what I guess it was aiming at, which is avoiding an add followed
by a remove in the not completely uncommon case where limit == 0 and the
regular expression is a terminator rather than a true separator ('\n', say).
(Normally the regular expression is a true separator so there will be no
trailing empty string even though limit is 0: "a,b,c".split(","), for example.)
Also, String.isEmpty is our fasest way of recognizing the empty string;
certainly better than equals("").
Change-Id: I82f4ec49fa58efc178e342cf55d4dfbbdad01c75
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Almost all uses of String.split in the Android codebase use trivial single
literal character separators. This patch optimizes that case to avoid the
use of regular expressions entirely.
The 10x speedup isn't the whole story, because the speedup is really
proportional to the number of separators in the input. 10x is easily
achievable, but the speedup could be arbitrarily high.
Before:
benchmark us logarithmic runtime
PatternSplitComma 84.8 XXXXXXXXXXXXXX||||||||||||||
PatternSplitLiteralDot 85.0 XXXXXXXXXXXXXX||||||||||||||
StringSplitComma 166.3 XXXXXXXXXXXXXXXXXXXXXXXXXXXX|
StringSplitHard 173.6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
StringSplitLiteralDot 167.7 XXXXXXXXXXXXXXXXXXXXXXXXXXXX|
After:
benchmark us logarithmic runtime
PatternSplitComma 18.9 XXX|||||||||||||||||||||
PatternSplitLiteralDot 19.0 XXX|||||||||||||||||||||
StringSplitComma 18.8 XXX|||||||||||||||||||||
StringSplitHard 174.2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
StringSplitLiteralDot 18.8 XXX|||||||||||||||||||||
(The benchmarks starting "Pattern" use a precompiled Pattern for performance.
Those starting "String" use String.split and would traditional entail a
temporary Pattern. As you can see, creating Patterns is very expensive for
us, and each one throws a finalizer spanner in the GC works too. The new
fast path avoids all this. I'll commit the benchmark -- along with all the
others I've ever used -- to http://code.google.com/p/dalvik this afternoon.)
Tests? We actually pass _more_ tests after this patch, because the increase
in performance means we don't hit timeouts.
Change-Id: I404298e21a78d72cf5ce6ea675844bf251e3825b
|
|
|
|
|
|
|
| |
I've fixed a few typos, and removed a few of the more egregiously nonsensical
or incorrect comments that were nearby.
Change-Id: I35851baebd532f949cc269f4738a26eeb9b6e697
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I started off with a mission to remove uses of dalvik.annotation.* (stuff
like @TestTargetNew and other useless junk that just makes it harder to
stay in sync with upstream). I wrote a script to go through tests showing
me the diff between what we have and what upstream has, thinking that in
cases where upstream has also added tests, I may as well pull them in at
the same time...
...but I didn't realize how close we were to having dx fill its 1.5GiB heap.
After trying various alternatives, I decided to bite the bullet and break
core-tests up into one .jar per module. This adds parallelism back into this,
the slowest part of our build. (I can do even better, but I'll do that in a
separate patch, preferably after we've merged recent changes from master.)
Only a couple of dependencies were problematic: the worthless TestSuiteFactory
which already contained a comment suggesting we get rid of it, and the fact
that some tests -- most notably the concurrent ones -- also contained main
methods that started the JUnit tty-based TestRunner.
(In the long run, we want to be running the harmony tests directly from a
pristine "svn co" of upstream, using DalvikRunner. But this will be a big
help in the meantime, and starts the work of getting our current copy of
the tests into a state where we can start to extract any meaningful
changes/additions we've made.)
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Notable changes:
- Reordered methods to be consistent with Harmony. Although our
implementations are significantly different, this will make
it easier to track Javadoc and signature changes.
- Some unchecked exceptions removed from method signatures
- Changed StringBuffer use to StringBuilder
- Changed PatternSyntaxException description field to 'desc' for
serialization compatibility.
commit deba65caf92e9c5b77b29bcf9dcb26d637af90cb
Merge: b239d4a 457c6cc
Author: Jesse Wilson <jessewilson@google.com>
Date: Wed Aug 12 09:23:58 2009 -0700
Merge branch 'regex_802921' into regex_dalvik
Conflicts:
libcore/regex/.classpath
libcore/regex/.settings/org.eclipse.jdt.core.prefs
libcore/regex/build.xml
libcore/regex/src/main/java/java/util/regex/AbstractCharClass.java
libcore/regex/src/main/java/java/util/regex/AbstractSet.java
libcore/regex/src/main/java/java/util/regex/CIDecomposedCharSet.java
libcore/regex/src/main/java/java/util/regex/CharClass.java
libcore/regex/src/main/java/java/util/regex/DecomposedCharSet.java
libcore/regex/src/main/java/java/util/regex/IntArrHash.java
libcore/regex/src/main/java/java/util/regex/JointSet.java
libcore/regex/src/main/java/java/util/regex/Lexer.java
libcore/regex/src/main/java/java/util/regex/MatchResult.java
libcore/regex/src/main/java/java/util/regex/Matcher.java
libcore/regex/src/main/java/java/util/regex/Pattern.java
libcore/regex/src/main/java/java/util/regex/PatternSyntaxException.java
libcore/regex/src/main/java/java/util/regex/SequenceSet.java
libcore/regex/src/main/java/java/util/regex/UCIDecomposedCharSet.java
libcore/regex/src/main/java/java/util/regex/UCISequenceSet.java
libcore/regex/src/main/java/org/apache/harmony/regex/internal/nls/messages.properties
libcore/regex/src/test/java/org/apache/harmony/tests/java/util/regex/Matcher2Test.java
libcore/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java
libcore/regex/src/test/java/org/apache/harmony/tests/java/util/regex/ModeTest.java
libcore/regex/src/test/java/org/apache/harmony/tests/java/util/regex/Pattern2Test.java
libcore/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternErrorTest.java
libcore/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternSyntaxExceptionTest.java
libcore/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java
libcore/regex/src/test/java/org/apache/harmony/tests/java/util/regex/ReplaceTest.java
libcore/regex/src/test/java/org/apache/harmony/tests/java/util/regex/SplitTest.java
commit b239d4a17905f9e0b609eeaa12de9dfba433c44a
Author: Jesse Wilson <jessewilson@google.com>
Date: Wed Aug 12 08:37:21 2009 -0700
Dalvik Regex
commit 457c6cca0629f20b118cd128353439763e40fe9e
Author: Jesse Wilson <jessewilson@google.com>
Date: Wed Aug 12 08:36:40 2009 -0700
Regex 802921
commit 51f4e67d71a8f92d8efa073fab32c540f6015594
Author: Jesse Wilson <jessewilson@google.com>
Date: Wed Aug 12 08:34:57 2009 -0700
Regex 527399
|
|\ \
| |/
| |
| |
| |
| |
| | |
Merge commit '5ca29e142032b6559824e4f7d526bbc037b90c93' into eclair-plus-aosp
* commit '5ca29e142032b6559824e4f7d526bbc037b90c93':
Fix "whatever".split(".") behavior.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Two special cases in Pattern.split's behavior had been incorrectly combined
into one. Separate the two cases, and add tests. I've run the tests against
Java 1.5 and 1.6 too.
Bug: 1957900
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
RegEx down to zero broken tests.'
Original author: ursg
Merged from: //branches/cupcake/...
Original author: android-build
Automated import of CL 146535
|
| |
| |
| |
| |
| |
| |
| |
| | |
Original author: jorgp
Merged from: //branches/cupcake/...
Original author: android-build
Automated import of CL 144835
|
| | |
|
| |
| |
| |
| |
| |
| | |
BUG=1285921
Automated import of CL 146126
|
|/
|
|
|
|
| |
BUG=1285921
Automated import of CL 144828
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|