Skip to content

refactor: use asyncpg instead of psycopg #876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 20, 2025

Conversation

matthiasschaub
Copy link
Member

@matthiasschaub matthiasschaub commented Feb 5, 2025

Description

Goal is to remove one of the two database libraries in use.

No performance degregation detectable.

road-comparison w/ psycopg & w/out @alru_cache:

hurl --repeat 100 --test --variable BASE_URL="http://127.0.0.1:8080" road-comparison.hurl
[...]
Executed files:    100
Executed requests: 100 (1.6/s)
Succeeded files:   100 (100.0%)
Failed files:      0 (0.0%)
Duration:          61449 ms

road-comparison w/ asyncpg & w/out @alru_cache:

hurl --repeat 100 --test --variable BASE_URL="http://127.0.0.1:8080" road-comparison.hurl
--------------------------------------------------------------------------------
Executed files:    100
Executed requests: 100 (1.7/s)
Succeeded files:   100 (100.0%)
Failed files:      0 (0.0%)
Duration:          60572 ms

building-comparison w/ psycopg & w/out @alru_cache:

hurl --test --repeat 5 --variable BASE_URL="http://127.0.0.1:8000" building-comparison.hurl
--------------------------------------------------------------------------------
Executed files:    5
Executed requests: 5 (0.1/s)
Succeeded files:   5 (100.0%)
Failed files:      0 (0.0%)
Duration:          43198 ms

building-comparison w/ asyncpg & w/out @alru_cache:

hurl --test --repeat 5 --variable BASE_URL="http://127.0.0.1:8000" building-comparison.hurl
--------------------------------------------------------------------------------
Executed files:    5
Executed requests: 5 (0.1/s)
Succeeded files:   5 (100.0%)
Failed files:      0 (0.0%)
Duration:          43985 ms

Corresponding issue

Closes #746

New or changed dependencies

  • None

TODO

  • Add HURL tests

Checklist

  • I have ensured my branch is mergeable with main (e.g. through git rebase main if necessary)
  • My code follows the style guide and was checked with pre-commit before committing
  • I have commented my code
  • I have added sufficient unit and integration tests
  • I have added new Hurl regression tests and checked all existing tests
  • I have updated the CHANGELOG.md

@matthiasschaub matthiasschaub force-pushed the use-single-database-client branch from 77ac5cb to 8f17765 Compare February 27, 2025 04:01
@matthiasschaub matthiasschaub force-pushed the use-single-database-client branch from ef36818 to 5d41a19 Compare May 20, 2025 07:04
matthiasschaub added a commit that referenced this pull request May 20, 2025
Move sql query file next to indicator module where it is used.

PR: #876

Closes #746
@matthiasschaub matthiasschaub force-pushed the use-single-database-client branch from 5d41a19 to 2ea6f00 Compare May 20, 2025 07:06
@matthiasschaub matthiasschaub changed the title test: psycopg vs asyncpg performance refactor: use asyncpg instead of psycopg May 20, 2025
@matthiasschaub matthiasschaub force-pushed the use-single-database-client branch from 38d0149 to 71b72c9 Compare May 20, 2025 07:10
@matthiasschaub matthiasschaub marked this pull request as ready for review May 20, 2025 07:10
Copy link

@matthiasschaub matthiasschaub merged commit 4712e11 into main May 20, 2025
3 checks passed
matthiasschaub added a commit that referenced this pull request May 20, 2025
Move sql query file next to indicator module where it is used.

PR: #876

Closes #746
@matthiasschaub matthiasschaub deleted the use-single-database-client branch May 20, 2025 07:18
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.

Do not use two database library
1 participant