Skip to content

optimize parameter processing and UUID conversion; enhance regex patt…#9

Merged
h0rn3t merged 5 commits into
mainfrom
0.1.1b4
Jan 4, 2026
Merged

optimize parameter processing and UUID conversion; enhance regex patt…#9
h0rn3t merged 5 commits into
mainfrom
0.1.1b4

Conversation

@h0rn3t

@h0rn3t h0rn3t commented Dec 21, 2025

Copy link
Copy Markdown
Owner

This pull request introduces several performance optimizations and code simplifications for the psqlpy_sqlalchemy package, with a focus on parameter conversion, UUID handling, and efficient query processing. The changes leverage Python version-specific features for improved speed and maintainability, and also update the package version.

Performance and compatibility improvements:

  • Refactored parameter and UUID conversion logic to use Python version-specific optimizations (e.g., direct class comparison, inlined comprehensions, and JIT-friendly constructs), reducing overhead in hot paths. Introduced Final constants and lru_cache for regex compilation to speed up repeated operations. [1] [2]
  • Unified and streamlined parameter conversion methods (_convert_params_single_pass, _convert_named_params_with_casting, and _process_parameters) to minimize redundant iterations and centralize UUID-to-bytes logic. [1] [2] [3]
  • Improved DML (INSERT/UPDATE/DELETE) detection and query handling by introducing a fast _check_dml helper, optimizing multi-row executemany and DML execution paths. [1] [2]

Benchmarking and testing:

  • Enhanced the benchmark script (performance_comparison.py) to warm up both database connections before timing, and to run asyncpg first, giving psqlpy the "second run" advantage for a fairer comparison.

Other changes:

  • Updated the package version to 0.1.1b4 in both psqlpy_sqlalchemy/__init__.py and pyproject.toml. [1] [2]

These changes collectively improve performance, maintainability, and the fairness of performance comparisons.…erns and caching for improved performance

Eugene Shershen added 3 commits December 21, 2025 22:57
@openhands-ai

openhands-ai Bot commented Dec 21, 2025

Copy link
Copy Markdown

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • ci

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #9 at branch `0.1.1b4`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

Eugene Shershen and others added 2 commits January 4, 2026 22:27
@h0rn3t h0rn3t merged commit e5e8630 into main Jan 4, 2026
9 checks passed
@h0rn3t h0rn3t deleted the 0.1.1b4 branch January 4, 2026 21:12
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