spark-instrumented-optimizer/common
Sean Owen 4576dfde19 [SPARK-28066][CORE] Optimize UTF8String.trim() for common case of no whitespace
## What changes were proposed in this pull request?

UTF8String.trim() allocates a new object even if the string has no whitespace, when it can just return itself. A simple check for this case makes the method about 3x faster in the common case.

## How was this patch tested?

Existing tests.

A rough benchmark of 90% strings without whitespace (at ends), and 10% that do have whitespace, suggests the average runtime goes from 20 ns to 6 ns.

Closes #24884 from srowen/SPARK-28066.

Authored-by: Sean Owen <sean.owen@databricks.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
2019-06-17 08:49:11 -07:00
..
kvstore [SPARK-27726][CORE] Fix performance of ElementTrackingStore deletes when using InMemoryStore under high loads 2019-05-21 10:22:21 -07:00
network-common [SPARK-27868][CORE] Better default value and documentation for socket server backlog. 2019-05-29 14:56:36 -07:00
network-shuffle [SPARK-27773][SHUFFLE] add metrics for number of exceptions caught in ExternalShuffleBlockHandler 2019-05-30 13:57:15 -07:00
network-yarn [SPARK-27773][FOLLOW-UP] Fix Checkstyle failure 2019-05-31 09:30:17 -07:00
sketch [SPARK-25956] Make Scala 2.12 as default Scala version in Spark 3.0 2018-11-14 16:22:23 -08:00
tags [SPARK-26026][BUILD] Published Scaladoc jars missing from Maven Central 2018-11-19 08:06:33 -06:00
unsafe [SPARK-28066][CORE] Optimize UTF8String.trim() for common case of no whitespace 2019-06-17 08:49:11 -07:00