forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speedup slicing from CompositeBytesReference (elastic#104861)
A few things here: 1. we don't allocate when slicing so no need for the non-zero-cost bounds checks from readArraySize, just read a vint. 2. we can skip creating an array in the slice method for the common single buffer case, this shows up quite hot in the profile 3. Binary search isn't all that useful for finding the end offset in the sub references when we already have the start offset. Even for very long buffers and long slices forward searching should be faster on modern CPUs.
- Loading branch information
1 parent
b205407
commit 6608a87
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters