Skip to content

Protect benches - #1

Merged
coderdan merged 20 commits into
mainfrom
protect-benches
Feb 4, 2026
Merged

Protect benches#1
coderdan merged 20 commits into
mainfrom
protect-benches

Conversation

@coderdan

@coderdan coderdan commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

Add Automated Benchmark Reporting System

Overview

This PR adds a comprehensive automated reporting system for benchmark results, improving documentation, and organizing generated artifacts. The changes transform raw benchmark data into readable, shareable reports with visualizations.

🎯 Key Features

  1. Automated Report Generation

• Python-based report generator (report_benchmarks.py) that processes benchmark results
• Generates markdown reports with:
◦ Ingest throughput tables and charts
◦ Query performance tables across multiple data set sizes
◦ SQL queries and parameters for each benchmark
◦ Database index definitions
◦ Performance indicators (⚠️) for queries exceeding 100ms
• Optional chart generation using matplotlib

  1. Organized Output Structure

• Created report/ directory for all generated artifacts
• Reports and charts are now tracked in git for historical comparison
• Cleaner repository root with separated source and generated files

  1. Comprehensive Documentation

• Main README.md: Complete project documentation covering:
◦ How to view benchmark results
◦ Detailed test setup information
◦ Step-by-step instructions for running benchmarks
◦ Troubleshooting guide
◦ Project structure overview
• README_REPORT.md: Detailed documentation for the report generator
• report/README.md: Documentation for the report directory
• MIT License added

  1. Enhanced Reporting Features

The report generator includes:
• SQL Query Display: Shows actual SQL statements used in benchmarks
• Query Parameters: Displays the parameter values passed to each query
• Index Definitions: Includes CREATE INDEX statements from sql/indexes/
• Performance Warnings: Visual indicators (⚠️) for slow queries (>100ms)
• Charts: Bar charts for ingest throughput, line charts for query performance
• Table of Contents: Easy navigation within reports

  1. Mise Task Integration

Added mise run report task for easy report generation:

mise run report                    # Default output to report/BENCHMARK_REPORT.md
mise run report custom_report.md   # Custom output location
  1. Code Quality Improvements

• Fixed inaccurate header comments in all src/bin/ files
• Updated documentation to reflect actual functionality
• Removed outdated TODO comments
• Clarified environment variable usage

coderdan and others added 20 commits January 19, 2026 16:32
- Connect to template1 when dropping postgres database to avoid 'cannot drop currently open database' error
- Replace test tables with integer_plaintext and integer_encrypted tables
- Use cs_encrypted_v2 type for encrypted column

Co-Authored-By: Warp <agent@warp.dev>
- Add anyhow dependency for better error handling
- Create generate_data binary to insert random integers into integer_plaintext table
  - Uses sqlx for database operations
  - Requires DATABASE_URL environment variable
  - Supports configurable NUM_RECORDS (default 10,000)
  - Batches inserts for efficiency
- Fix encrypted column type to eql_v2_encrypted
- Add IF NOT EXISTS to CREATE TABLE statements
- Remove data loading step from setup-db task
- Add psql task to connect to Docker-managed database

Co-Authored-By: Warp <agent@warp.dev>
- Updated dependencies in Cargo.toml for enhanced features.
- Introduced new Docker Compose setup for PostgreSQL.
- Added `encrypt_data` binary for encrypting integers using CipherStash.
- Improved `generate_data` binary with better error handling and logging.
- Refactored `exact_lookup` benchmark for cleaner code and better readability.
- Created a new `lib.rs` for ingest options management.
- Updated `sqlx` version from 0.6 to 0.8 in `Cargo.toml`.
- Modified various dependencies in `Cargo.lock` to their latest versions, including `event-listener`, `atoi`, and `base64`.
- Added new dependencies such as `concurrent-queue`, `const-oid`, and `flume`.
- Updated performance metrics in JSON result files for encryption tests, reflecting changes in execution time and memory usage for different record sizes.
- Adjusted timestamps in JSON files to reflect the latest test runs.
…ndling; add preparation script for string_encrypted table
…eparation script for table handling; add SQL index management for integer_encrypted
…ables

- Added benchmark results for various operations on encrypted data, including ORE (Order-Revealing Encryption) benchmarks for different data sizes.
- Created SQL scripts to drop and create indexes for integer and string encrypted tables with various sizes (10,000 to 10,000,000).
- Updated schema to include new tables for integer and string encrypted data.
- Modified encryption scripts to dynamically set table names based on an environment variable for better flexibility.
- Updated benchmark result files for MATCH queries with new metrics and improved estimates.
- Added a new binary `combine_benchmark` to consolidate hyperfine benchmark results with system metadata.
- Enhanced documentation in `encrypt_int`, `encrypt_json_large`, `encrypt_json_small`, and `generate_data` binaries to clarify functionality and environment variable requirements.
- Improved comments to reflect the current state of the CipherStash client API and its usage in the encryption processes.
@coderdan
coderdan merged commit 5b39c39 into main Feb 4, 2026
coderdan added a commit that referenced this pull request Jul 9, 2026
… + field_gt

Addresses PR #23 review (James's items #1 and #2):

- setup-db-v3 now installs the pinned eql-3.0.0-alpha.3 release bundle
  instead of building from a local eql_v3 checkout. alpha.3 moved the
  per-domain types eql_v3.* -> public.* and removed jsonb_query, so the
  whole v3 surface is migrated to public.<type> (schema_v3.sql, sql/indexes,
  *_v3 benches, encrypt binaries, src/v3.rs); eql_v3.* FUNCTIONS
  (eq_term/ord_term/match_term/ord_ope_term/ore_cllw/jsonb_*) are unchanged.
- Verified no bench/index/schema calls a moved eql_v3_internal extractor
  (hmac_256/bloom_filter/ore_block_256/ope_cllw) directly — item #2.

JSON bench now queries through the named EQL JSON functions rather than raw
jsonb @>/-> operators:
- contains/extractor: eql_v3.jsonb_contains(value, $1) on GIN(eql_v3.jsonb_array(value))
- field access: eql_v3.jsonb_path_query_first(value, sel) feeding eql_v3.eq_term / eql_v3.ore_cllw
- new scenario json/field_gt/functional: the encrypted `x->'y' > 10` range
  query -- `>` on public.jsonb_entry inlines to ore_cllw compare, reusing
  field_order_idx (no new index).

Re-ingested + re-ran the JSON tiers 10k-1M-10M against alpha.3 in an isolated
DB and regenerated report/V3_COMPARISON.md + report/BENCHMARK_REPORT.md.
contains/functional @10m improves 3.36ms -> 1.05ms (jsonb_array recipe).
Non-JSON v3 numbers remain the alpha.2-equivalent baseline pending a full
re-baseline (flagged by a "Re-baseline status" banner in the report).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant