GH-15171: [C++] Pass std::string_view by value#33684
Conversation
|
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or In the case of PARQUET issues on JIRA the title also supports: See also: |
cpp/CMakeLists.txt
Outdated
There was a problem hiding this comment.
I don't think we want to enable this by default. You should pass this yourself to CMake using -DCMAKE_EXPORT_COMPILE_COMMANDS=1.
There was a problem hiding this comment.
This is a vendored file (as the file path suggests), so we shouldn't do such changes to it. Can you revert them?
e1f2491 to
2906008
Compare
|
@ursabot please benchmark lang=C++ |
|
Benchmark runs are scheduled for baseline = 4d9228f and contender = 2906008e491ab5985b26e97781fa750d2c9c4167. Results will be available as each benchmark for each run completes. |
|
|
revert revert
73e02da to
724770a
Compare
|
Rebased to fix lint error. |
|
Looks Glib & Ruby CI error is not related? cc @kou |
|
Not related. It's sometimes happen. I couldn't reproduce it on local environment... |
|
Benchmark runs are scheduled for baseline = 44b0932 and contender = 641d1da. 641d1da is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
|
@ucasfl thanks for cleaning this up! |
|
Some curiosity-driven feedback CC @ucasfl @westonpace @pitrou. I read https://quuxplusone.github.io/blog/2021/11/09/pass-string-view-by-value/ with curiosity and was wondering if this patch here resulted in a measurable performance difference somewhere on the user-facing surface of Arrow. Before Christmas I build a benchmark that I called When this commit landed, said benchmark got faster by (roughly) three percent: The plot/data can be further explored here: https://conbench.ursa.dev/benchmarks/bc6d37ffe2614078814efb01402f64dd/ Of course this is just correlation (once this was merged, the benchmark got a tad faster) and not necessarily causation (for corroborating this I understand too little of the impact of this change). But yeah, it's probably fair to say that it's not unlikely that this change here was responsible for the perf change. |

Which issue does this PR close?
Closes #15171.
Rationale for this change
What changes are included in this PR?
Pass std::string_view by value, not by const-ref
Are these changes tested?
Are there any user-facing changes?
No.