Skip to content

codegen only used functions in duckdb C API#8491

Merged
myrrc merged 1 commit into
developfrom
myrrc/duckdb-api-codegen
Jun 18, 2026
Merged

codegen only used functions in duckdb C API#8491
myrrc merged 1 commit into
developfrom
myrrc/duckdb-api-codegen

Conversation

@myrrc

@myrrc myrrc commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Make duckdb-vortex compilation slightly faster

Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
@myrrc myrrc requested a review from a team June 18, 2026 11:29
@myrrc myrrc added the changelog/chore A trivial change label Jun 18, 2026
@myrrc myrrc requested a review from 0ax1 June 18, 2026 11:29
@myrrc myrrc added the ext/duckdb Relates to the DuckDB integration label Jun 18, 2026
@myrrc myrrc enabled auto-merge (squash) June 18, 2026 11:29
@codspeed-hq

codspeed-hq Bot commented Jun 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
❌ 3 regressed benchmarks
✅ 1575 untouched benchmarks
⏩ 3 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_varbinview_canonical_into[(1000, 10)] 162.1 µs 198.6 µs -18.39%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 178.2 µs 214.7 µs -17.01%
Simulation chunked_varbinview_canonical_into[(100, 100)] 274 µs 308.4 µs -11.15%
Simulation chunked_varbinview_opt_canonical_into[(1000, 10)] 214.7 µs 177.8 µs +20.8%
Simulation bitwise_not_vortex_buffer_mut[128] 215.3 ns 186.1 ns +15.67%
Simulation bitwise_not_vortex_buffer_mut[1024] 275.6 ns 246.4 ns +11.84%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing myrrc/duckdb-api-codegen (4955ddd) with develop (202953d)

Open in CodSpeed

Footnotes

  1. 3 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.

extern "C" {
#endif // __cplusplus

/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come these are dropped and why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had had a double check: one in cbingden option, other in header/trailer. I've removed the hand-written one.

Comment thread vortex-duckdb/build.rs

// Duckdb C API function we use.
// This lowers codegen'd src/cpp.rs by four times.
const DUCKDB_C_API_FUNCTIONS: [&str; 134] = [

@0ax1 0ax1 Jun 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The binary gets smaller but also all API is now hidden behind having to change the build.rs when not exposed explicitly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to extend Rust API, you still likely need to look into duckdb.h/.hpp, and you need to write a Rust wrapper over Rust unsafe {} functions, so we're not losing anything here.

@0ax1 0ax1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a bit tedious to maintain a custom list, but alright let's try this in practice.

@myrrc myrrc merged commit c2119d9 into develop Jun 18, 2026
90 of 94 checks passed
@myrrc myrrc deleted the myrrc/duckdb-api-codegen branch June 18, 2026 12:41
robert3005 pushed a commit that referenced this pull request Jun 18, 2026
Make duckdb-vortex compilation slightly faster

Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change ext/duckdb Relates to the DuckDB integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants