aiopg icon indicating copy to clipboard operation
aiopg copied to clipboard

Make benchmark

Open asvetlov opened this issue 10 years ago • 2 comments

sync psycopg vs aiopg vs aiopg.sa vs aiopg.sa with query caching

asvetlov avatar May 08 '14 12:05 asvetlov

Hello.

I've made benchmark, it can run psycopg, aiopg and aiopg_sa. Take note, benchmark runs psycopg with concurrency number of threads. There is only one query into benchmarks, simple select. I need same suggestion what types of queries need to check. And main question how to test cache? Can I use precompiled sqlalchemy query for this? I've made aiopg_sa, but how can I cache it? Here same results:

Running psycopg benchmarks...

['simple_select']

373705 queries in 30.0 seconds Latency: min 0.15ms; max 10.11ms; mean 0.795ms; std: 0.548ms (69.03%) Latency distribution: 25% under 0.386ms; 50% under 0.637ms; 75% under 1.044ms; 90% under 1.532ms; 99% under 2.635ms; 99.99% under 6.183ms Queries/sec: 12456.37 Rows/sec: 1245636.61

Running aiopg benchmarks...

['simple_select']

186569 queries in 30.0 seconds Latency: min 0.72ms; max 6.19ms; mean 1.602ms; std: 0.112ms (6.97%) Latency distribution: 25% under 1.543ms; 50% under 1.598ms; 75% under 1.664ms; 90% under 1.722ms; 99% under 1.866ms; 99.99% under 3.523ms Queries/sec: 6218.82 Rows/sec: 621881.61

Running aiopg_sa benchmarks...

['simple_select']

79803 queries in 30.0 seconds Latency: min 1.54ms; max 17.9ms; mean 3.752ms; std: 0.785ms (20.92%) Latency distribution: 25% under 3.417ms; 50% under 3.587ms; 75% under 3.85ms; 90% under 4.2ms; 99% under 8.022ms; 99.99% under 17.815ms Queries/sec: 2659.86 Rows/sec: 265985.77

I've pushed code to fork/branch 'benchmark', https://github.com/OmJan/aiopg/tree/benchmark

VelikiiNehochuha avatar Nov 26 '17 19:11 VelikiiNehochuha

Update node benchmark to allow aiopg handles precompiled queries

VelikiiNehochuha avatar Nov 27 '17 11:11 VelikiiNehochuha