diff options
author | Taras Tsugrii <ttsugrii@fb.com> | 2018-08-02 04:31:12 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-02 04:32:39 -0700 |
commit | 13ebd67cf8ea756a0e82eaa03f0f4a9581ccf9be (patch) | |
tree | 2010da08cc29d7251093b99a1d2bef3553888951 /src/main/java/com/google/devtools/build/lib/skyframe/PackageRootsNoSymlinkCreation.java | |
parent | bbb32f3f3c487de5e133b74026df72150974d7a5 (diff) |
[Skylark] Speed up string.partition function.
According to JMH using `ImmutableList.of` or `Arrays.asList` is ~2X faster
than using existing approach of creating an empty `ArrayList` with expected
size and populating it using `add` method. This is most likely due to extra
range and capacity checks.
Returning `ImmutableList` instead of `ArrayList` avoids the need to copy it
again in order to create a `SkylarkTuple`.
These changes speed up the function by ~3X.
Closes #5736.
PiperOrigin-RevId: 207079605
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PackageRootsNoSymlinkCreation.java')
0 files changed, 0 insertions, 0 deletions