-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PERF] Greatly speed up Variable Length Concat (#1748)
* before Were we using Arrow Growable for Concating UTF8 and Binary Arrays, which only allocated memory for the offset array * Now we preallocate the value array since we know the complete size of the target array.
- Loading branch information
Showing
2 changed files
with
79 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from __future__ import annotations | ||
|
||
import uuid | ||
|
||
from daft.series import Series | ||
|
||
|
||
def test_string_concat(benchmark) -> None: | ||
NUM_ROWS = 100_000 | ||
data = Series.from_pylist([str(uuid.uuid4()) for _ in range(NUM_ROWS)]) | ||
to_concat = [data] * 100 | ||
|
||
def bench_concat() -> Series: | ||
return Series.concat(to_concat) | ||
|
||
benchmark(bench_concat) |