Optimizing multi-source byte range reading in JSON reader - #15396
Conversation
vuule
left a comment
There was a problem hiding this comment.
suggestions with a side of scope creep :D
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
…byte-range-improvement
|
/ok to test |
|
/ok to test |
| datasource::owning_buffer<rmm::device_uvector<char>> outdata(std::move(outbuf)); | ||
| std::swap(indata, outdata); |
There was a problem hiding this comment.
This looks like it's significant, but I didn't grasp it.
What's the advantage of swapping in place over, say, assigning to indata?
There was a problem hiding this comment.
My reasoning here was that after the RMM buffer in indata datasource has been normalized, we can discard the buffer. Rather than copying outdata to indata with the implicitly generated copy assignment operator in owning_buffer, I thought swapping it would be faster.
mythrocks
left a comment
There was a problem hiding this comment.
Some minor nitpicks, and a clarifying question.
hyperbolic2346
left a comment
There was a problem hiding this comment.
A few nits and questions
| // of subchunks. | ||
| size_t buffer_size = | ||
| reader_compression != compression_type::NONE | ||
| ? total_source_size * compression_ratio + 4096 |
There was a problem hiding this comment.
Why are we adding 4096? Is that for headers?
There was a problem hiding this comment.
Yes, 4096 is for the headers. I've used the uncompressed buffer size estimate from https://github.com/rapidsai/cudf/blob/064dd7b02166cc67e882b708d66621bc3fafd70b/cpp/src/io/comp/uncomp.cpp#L361
There was a problem hiding this comment.
Would be nice to have this guess defined instead of a hard-coded value. I'm ok either way though.
|
/ok to test |
|
/ok to test |
hyperbolic2346
left a comment
There was a problem hiding this comment.
Just nits from me this time.
…byte-range-improvement
|
/ok to test |
|
/merge |
Description
This piece of work seeks to achieve two goals - (i) reducing repeated reading of byte range chunks in the JSON reader, and (ii) enabling multi-source byte range reading for chunks spanning sources.
byte_rangeoption is used inread_json#15185 to reduce the repeated reading of follow-on chunks while searching for the end of the last row in the requested chunk. After the requested chunk, the following chunks are divided into subchunks, and read until the delimiter character is reached.Visualization of the performance improvement with this optimization
Checklist