Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Dec 31, 2025

Summary

This PR reorganizes the Rust file structure to match the patterns used in Comparisons.Neo4jVSDoublets, making it easier to compare PostgreSQL and Doublets implementations side-by-side.

Fixes #19

Key Changes

1. Benchmark File Structure Reorganization

The benchmarks are now split into two separate modules for clear comparison:

rust/benches/benchmarks/
├── mod.rs              # Main module with documentation and re-exports
├── doublets/           # All Doublets benchmarks
│   ├── mod.rs          # Doublets module documentation
│   ├── create.rs       # Link creation benchmark
│   ├── delete.rs       # Link deletion benchmark
│   ├── update.rs       # Link update benchmark
│   └── each/           # Query benchmarks
│       ├── mod.rs
│       ├── all.rs      # Query all links
│       ├── identity.rs # Query by ID
│       ├── concrete.rs # Query by source+target
│       ├── outgoing.rs # Query by source
│       └── incoming.rs # Query by target
└── psql/               # All PostgreSQL benchmarks
    ├── mod.rs          # PostgreSQL module documentation
    ├── create.rs       # INSERT benchmark
    ├── delete.rs       # DELETE benchmark
    ├── update.rs       # UPDATE benchmark
    └── each/           # SELECT benchmarks
        ├── mod.rs
        ├── all.rs      # SELECT all
        ├── identity.rs # SELECT by ID
        ├── concrete.rs # SELECT by source+target
        ├── outgoing.rs # SELECT by source
        └── incoming.rs # SELECT by target

2. Benched Trait Implementation Split

The Benched trait implementations are now organized in a separate module:

rust/src/benched/
├── mod.rs              # Benched trait definition with documentation
├── doublets_benched.rs # Doublets storage backend implementations
└── psql_benched.rs     # PostgreSQL storage backend implementations

3. Documentation Improvements

  • Added comprehensive module-level documentation with operation tables
  • Each file includes doc comments explaining the implementation approach
  • SQL queries are documented in the PostgreSQL benchmark files
  • Time complexity notes are included for both backends

4. Benchmark Organization

  • Separate criterion_group! for PostgreSQL and Doublets benchmarks
  • Prefixed exports (psql_* and doublets_*) for clear identification
  • Parallel structure between psql/ and doublets/ directories

5. Additional Improvements

  • Added Rust-specific entries to .gitignore (target/, debug/, *.rs.bk, mutants.out/, etc.) following Neo4jVSDoublets pattern
  • Fixed typo in README.md: "diffrence" → "difference"

Comparison with Neo4jVSDoublets

Aspect Neo4jVSDoublets PostgreSQLVSDoublets (after)
Backend dirs neo4j/, doublets/ psql/, doublets/
Operation files Separate per operation Separate per operation
Query subdir each/ each/
Module docs Detailed tables Detailed tables
Criterion groups Separate per backend Separate per backend
Benched trait src/benched/ with separate files src/benched/ with separate files
.gitignore Rust-specific patterns Rust-specific patterns ✓

Test Plan

  • cargo check passes for library
  • cargo check --benches passes for benchmarks
  • File structure mirrors Neo4jVSDoublets pattern
  • .gitignore includes Rust-specific entries
  • README typo fixed
  • CI workflow runs successfully

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #19
@konard konard self-assigned this Dec 31, 2025
…ttern

Split benchmarks into separate psql/ and doublets/ directories for clear
comparison between implementations. Each backend now has its own module with
dedicated files for each operation (create, delete, update, each/).

Key changes:
- Created benchmarks/doublets/ and benchmarks/psql/ directories
- Split each benchmark file into backend-specific implementations
- Added comprehensive module-level documentation with operation tables
- Updated bench.rs to use separate criterion groups for each backend
- Added documentation comments explaining SQL queries and algorithms

This structure mirrors https://github.com/linksplatform/Comparisons.Neo4jVSDoublets
making side-by-side comparison of implementations easier.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] Use best ideas and practices from https://github.com/linksplatform/Comparisons.Neo4jVSDoublets Reorganize Rust benchmark file structure following Neo4jVSDoublets pattern Dec 31, 2025
Reorganized src/benched.rs into:
- src/benched/mod.rs - Benched trait definition with documentation
- src/benched/doublets_benched.rs - Doublets storage implementations
- src/benched/psql_benched.rs - PostgreSQL storage implementations

This follows the same pattern used in Neo4jVSDoublets for clear separation
between backend implementations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review December 31, 2025 10:59
@konard
Copy link
Member Author

konard commented Dec 31, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $7.484584 USD
  • Calculated by Anthropic: $5.446306 USD
  • Difference: $-2.038278 (-27.23%)
    📎 Log file uploaded as GitHub Gist (821KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Member Author

konard commented Dec 31, 2025

🔄 Auto-restart 1/3

Detected uncommitted changes from previous run. Starting new session to review and commit them.

Uncommitted files:

?? rust/target/

Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback.

- Add Rust build artifacts (target/, debug/) to .gitignore following
  Neo4jVSDoublets pattern
- Add rustfmt backup files, mutants.out, and RustRover entries
- Fix typo: "diffrence" → "difference" in README.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard
Copy link
Member Author

konard commented Dec 31, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $1.837612 USD
  • Calculated by Anthropic: $1.193004 USD
  • Difference: $-0.644608 (-35.08%)
    📎 Log file uploaded as GitHub Gist (1253KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 0e0cc99 into main Dec 31, 2025
2 checks passed
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.

Use best ideas and practices from https://github.com/linksplatform/Comparisons.Neo4jVSDoublets

2 participants