ARROW-2905: [C++] Remove raw_data_ member from BufferBuilder, adaptive int builders#3863
Conversation
|
Since ARROW-2905 was opened a good bit of logic is now centralized in buffer-builder.h. There are still raw pointers in use there. Do they impact builder performance? As I recall the prior discussion suggested that the behavior may have changed from gcc 4 to gcc 5+ |
|
Removing DetailsOrthogonal but noteworthy: BooleanBuilder seems to do much better under GCC 4.8 |
|
Thanks for looking further into this! I would like to add a few new benchmarks to be a bit more paranoid. Most of those benchmarks are vector appends and so aren't really going to be affected by this change (compared with scalar append paths) |
|
I can look into that, it's not urgent |
|
Well then should we close this PR until we write scalar append benchmarks? |
|
I can write it today |
|
I can't figure out how to disable Turbo Boost on my Thinkpad P1 so take the benchmarks with a grain of salt, but I don't see an appreciable difference so that's good =) Some of the noise seems to be due to memory allocation before: after: BTW I have started normalizing microbenchmarks to use |
|
Similar reasoning probably applies to PrimitiveArray::raw_values_, ListArray::raw_value_offsets_, BinaryArray::raw_data_, raw_value_offsets_, and UnionArray::raw_type_ids_, raw_value_offsets_ |
f6cdeb8 to
6ace172
Compare
|
Hm looks like there are some valgrind issues |
6ace172 to
77c78ee
Compare
49c0498 to
d460788
Compare
|
It's hard to really tell whether this is causing an impact or not. The most affected benchmarks by this change are the BinaryBuilder benchmarks, because they append 10-length strings to create an approx 160MB data structure. I increased these benchmarks to run with MinTime 10 seconds, made sure to disable CPU throttling, and I'm showing roughly 1-3% perf degradation before: after This is probably much ado about nothing, but I'm concerned that we lack appropriate benchmarking infrastructure to evaluate this decision. Since there's an effort to establish better benchmarking systems in the next couple of months, I recommend we do not merge this patch now and wait until we can get more data points (using this patch to help determine whether we have a rigorous process in place to determine whether a patch creates a statistically significant performance improvement or regression) |
Codecov Report
@@ Coverage Diff @@
## master #3863 +/- ##
=========================================
+ Coverage 87.76% 88.57% +0.8%
=========================================
Files 727 593 -134
Lines 89507 79926 -9581
Branches 1252 0 -1252
=========================================
- Hits 78557 70791 -7766
+ Misses 10836 9135 -1701
+ Partials 114 0 -114
Continue to review full report at Codecov.
|
|
The |
fsaintjacques
left a comment
There was a problem hiding this comment.
There's issues with ignoring AllocateResizableBuffer return status.
d460788 to
580d284
Compare
| std::shared_ptr<ResizableBuffer> buffer_; | ||
| MemoryPool* pool_; | ||
| uint8_t* data_; | ||
| int64_t capacity_; |
There was a problem hiding this comment.
Just curious, if data_ can be replaced by buffer->data(), then capacity_ can also be replaced by buffer_->capacity() right?
|
This PR seems like a good test case for the benchmark reporter. We also need to look at the performance on Windows since MSVC might be doing different things |
|
@bkietz can you rebase, and then use Ursabot to check? |
|
Closing this stale PR, please reopen when it gets picked up again |
Removing this member had no appreciable effect on performance in the builder benchmark: