DuckDB Finance Quant SQL Extension

Performance Testing

The extension keeps two layers of performance coverage:

  1. make perf profiles the complete gold-test corpus with DuckDB JSON profiling enabled. Because scripts/check_function_tests.py and scripts/check_function_perf_tests.py both verify that every registered fin_* function is referenced by test/sql/gold_tests.sql, this gives every function at least one profiled execution. The compatibility coverage in the same corpus also profiles the checked source-surface aliases used for regression testing.
  2. examples/hot_path_benchmark.sql contains heavier benchmark queries for the highest-volume model families, including option pricing and Greeks, binomial pricing, bond analytics, cash-flow solvers, curve helpers, portfolio math, returns/risk aggregates, date/calendar helpers, and compatibility payload analogues used in regression coverage.

Run the full function-surface profile:

make perf DUCKDB_ROOT=/path/to/duckdb

By default the profile is written to:

/tmp/duckdb-finance-profile.json

Use PERF_OUTPUT to write somewhere else:

make perf DUCKDB_ROOT=/path/to/duckdb PERF_OUTPUT=/tmp/finance-profile.json

Run the focused hot-path benchmark from a checkout of this repository after installing and loading the published extension:

INSTALL finance FROM community;
LOAD finance;
.read examples/hot_path_benchmark.sql

Until the community package is published, use the same source-built DuckDB and local extension flow as the Makefile targets above. The .read path is relative to the repository checkout where the DuckDB shell is running.

CI Coverage

make check runs:

The GitHub Pages workflow publishes the docs/ site from main, so this page and the generated function reference are deployed with the rest of the documentation website.