psqlpy-python / psqlpy

Asynchronous Python PostgreSQL driver written in Rust
https://psqlpy-python.github.io/
MIT License
227 stars 3 forks source link

Benchmarking.. #43

Closed JMarkin closed 4 months ago

JMarkin commented 5 months ago

Hello, thank you for great job.

I added your driver to pgbeanch from MagicStack team. And result super different then your. Full report https://public.jmarkin.ru/pgbeanch.html

Example result

image

psqlpy slower than all of other driver: aiopg, psycopg, asyncpg, etc.

Can you help me understand why your beanchmark give better results?

chandr-andr commented 5 months ago

@JMarkin Hello! Thanks for testing the library. I'm going to look into it.
As for benchmark I made, I didn't want to show the raw performance of the library, so I tested it within FastAPI and not local PostgreSQL

As far as I know, MagicStack benchmark is a little strange cuz it shows that psycopg 5! times slower than asyncpg, I haven't seen such outperformance in any test I've made.

chandr-andr commented 5 months ago

@JMarkin Plus, you can check this issue (https://github.com/piccolo-orm/piccolo/issues/986) with some discussion with the piccolo-orm creator and member, where we've tested asyncpg and psqlpy performance.
The difference isn't big (I explained why) but it's here.

Last but not least, you can check this repo https://github.com/ymezencev/db_perf, it uses the old version of psqlpy, but it beats the asyncpg.

chandr-andr commented 4 months ago

Moved to discussions