Add benchmark suite comparing PL/Ruby to sibling PLs#7
Merged
Conversation
Mirrors PL/php's bench/ + doc/benchmarks.md layout for PL/Ruby: - bench/setup.sql: four workloads (call overhead, string/numeric ops, SPI row loop, array marshaling) written with matching semantics in PL/Ruby, PL/pgSQL, PL/Perl, PL/Python and PL/Tcl. Functions are cross-checked to return identical results before timing. - bench/run.sh: pgbench -c 1 harness that reports TPS per function per language; missing extensions are reported as skipped, not fatal. - doc/benchmark.md: first published numbers (PostgreSQL 18.4, Ruby 3.2), results table and analysis. PL/Ruby is at parity on compute, mid-pack on SPI row iteration, and second only to PL/Python on array marshaling; a small fixed call-overhead tax comes from the protected MRI entry path. Linked from the README documentation list. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirrors PL/php's
bench/+doc/benchmarks.mdlayout, extended to five languages and four workloads.What's here
bench/setup.sql— four workloads with matching semantics in PL/Ruby, PL/pgSQL, PL/Perl, PL/Python and PL/Tcl: call overhead, string/numeric ops, an SPI loop over 1,000 rows, and int[] array marshaling. All five languages are cross-checked to return identical results before timing.bench/run.sh—pgbench -c 1harness reporting TPS per function per language; a missing PL is reported asskipped, not fatal. Configurable viaSECS,LANGS,PGBENCH,PGPORT.doc/benchmark.md— first published numbers (PostgreSQL 18.4, Ruby 3.2, Ubuntu 24.04 / x86-64), results table and analysis, linked from the README.Findings (representative TPS)
PL/Ruby is at parity on compute, mid-pack on SPI row iteration, and second only to PL/Python on array marshaling. The small fixed call-overhead tax is the protected MRI entry path (
rb_protect/rb_eval) that makes Ruby exceptions catchable PostgreSQL errors.Numbers were produced in the
plruby-buildcontainer and confirmed across two runs.🤖 Generated with Claude Code