New C++ api#8651
Conversation
Merging this PR will not alter performance
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | rebuild_naive |
91.2 µs | 105.4 µs | -13.45% |
| ⚡ | WallTime | cuda/bitpacked_u8/unpack/3bw[100M] |
350.4 µs | 299.4 µs | +17.05% |
| ⚡ | Simulation | chunked_varbinview_into_canonical[(100, 100)] |
307.5 µs | 272.5 µs | +12.84% |
| ⚡ | Simulation | bitwise_not_vortex_buffer_mut[128] |
273.6 ns | 244.4 ns | +11.93% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing myrrc/cxx2 (de2512a) with develop (f1465af)2
Footnotes
-
4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
develop(596099c) during the generation of this report, so f1465af was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
05babc3 to
5795c45
Compare
a044015 to
a5c7567
Compare
6b2036e to
66bfb31
Compare
| @@ -490,20 +490,32 @@ jobs: | |||
| - uses: ./.github/actions/setup-prebuild | |||
| with: | |||
| enable-sccache: "true" | |||
There was a problem hiding this comment.
We didn't delete vortex-cxx/src/read.rs?
| @@ -475,8 +475,8 @@ jobs: | |||
| command: check ${{ matrix.checks }} | |||
|
|
|||
| cxx-test: | |||
| @@ -0,0 +1,1152 @@ | |||
| // SPDX-License-Identifier: Apache-2.0 | |||
| // SPDX-FileCopyrightText: Copyright the Vortex contributors | |||
| #pragma once | |||
There was a problem hiding this comment.
Is this header checked by .clang-tidy? (and the src file)
| @@ -0,0 +1,6 @@ | |||
| # SPDX-License-Identifier: Apache-2.0 | |||
| # SPDX-FileCopyrightText: Copyright the Vortex contributors | |||
| NamespaceIndentation: None | |||
There was a problem hiding this comment.
Why do we introduce a new formatting here? We have a ref formatting .clang-format at the repo top-level.
| }; | ||
|
|
||
| // 16-bit float | ||
| struct f16 { |
There was a problem hiding this comment.
I guess we could detect at build time what C++ version the compiler supports and branch on using the C++23 std lib f16 or our custom one.
|
|
||
| // Types that a PrimitiveView can hold | ||
| template <class T> | ||
| concept view_type = primitive_type<T> || std::is_same_v<T, bool>; |
There was a problem hiding this comment.
primitive_view? view_type in isolation reads vague.
| * Estimated count. Throws if not known(). For inexact estimates this is | ||
| * is an upper bound. | ||
| */ | ||
| uint64_t value() const; |
There was a problem hiding this comment.
Not sure I understand this API. Why not just have value? What's the flow when the caller passes in the fallback. And why does that need to handled in a method of Estimate?
|
|
||
| // List accessors. Valid only on List and FixedSizeList dtypes | ||
|
|
||
| DataType list_element() const; |
There was a problem hiding this comment.
Every public fn in this PR added needs docs.
|
|
||
| namespace dtype { | ||
|
|
||
| inline constexpr bool Nullable = true; |
There was a problem hiding this comment.
What's the naming convention we wanna go for? Nullable reads like a type. Google convention is kNullable, using the k prefix for constants.
| @@ -0,0 +1,6 @@ | |||
| # SPDX-License-Identifier: Apache-2.0 | |||
| # SPDX-FileCopyrightText: Copyright the Vortex contributors | |||
| InheritParentConfig: true | |||
There was a problem hiding this comment.
Same here as for .clang-format. Whatever we do for vortex-cxx should be repo global I think.
|
|
||
| int main(int argc, char** argv) { | ||
| if (argc != 2) { | ||
| std::cerr << "Usage: dtype <file glob>\n"; |
There was a problem hiding this comment.
nit: Isn't it Usage: <dtype> <file glob>\
| fs::temp_directory_path() / "hello_vortex_example.vortex"; | ||
| std::cout << "Writing to: " << out.string() << '\n'; | ||
|
|
||
| Session session; |
There was a problem hiding this comment.
=> rename to VortexSession, given that session is a generic description?
|
|
||
| private: | ||
| void reset() noexcept { | ||
| if (!path_.empty()) { |
There was a problem hiding this comment.
Do we care about checking the error in tests?
| return BytesView(std::move(canonical), std::move(validity), n); | ||
| } | ||
|
|
||
| Array make_struct( |
There was a problem hiding this comment.
Why actually not && in the signature for the return type?
| } | ||
|
|
||
| void StructArrayBuilder::Deleter::operator()( | ||
| vx_struct_column_builder* ptr) const noexcept { |
There was a problem hiding this comment.
What's our rule of thumb for sprinkling noexcept?
| bits_ = other.bits_; | ||
| bit_offset_ = other.bit_offset_; | ||
| all_invalid_ = other.all_invalid_; | ||
| other.owner_ = nullptr; |
There was a problem hiding this comment.
Why is = nullptr responsibility of the assignment operator?
| } | ||
| session_ = std::move(other.session_); | ||
| stream_ = other.stream_; | ||
| other.stream_ = ArrowArrayStream{}; |
There was a problem hiding this comment.
Also here we do why change other? other.stream_ = ArrowArrayStream{};
| #include <utility> | ||
| #include <vector> | ||
|
|
||
| /** |
There was a problem hiding this comment.
Same here, let's think about whether all of this should go into a single header. We can still have a convenience vortex.hpp header with only include statements.
Replace C++ api with a new one which depends on vortex-ffi. Remove cxx from workspace. Port FFI examples and tests to C++ examples as tests.
Add vx_expression_clone to C FFI.
Remove const modifier from output from vx_expression_not