Skip to content
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

Rework benchmarks #2507

Merged
merged 1 commit into from
Nov 3, 2020
Merged

Rework benchmarks #2507

merged 1 commit into from
Nov 3, 2020

Conversation

weiznich
Copy link
Member

Create a distinct benchmark suite that tests various different rust database connection crates: Those benchmarks are created with the following goals:

a) To track diesels performance and find potential regressions
b) To evaluate potential alternatives for the currently used C-dependencies
c) To compare diesel with the competing crates

It currently supports the following database systems:

  • PostgreSQL
  • MySQL/MariaDB
  • SQLite

and the following crates:

I've included other crates as well into this setup as there are at least 2 pure rust database connection implementations for postgres and mysql. As an long term goal it can be interesting for diesel to switch away from using the corresponding c based libraries for those database to simplify the setup + replace potential unsafe C code with mostly safe rust code. In my opinion such a replacement should at least full fill the following requirements:

  • Provide a comparable level of performance to the platform native c libraries
  • Be a mature actively maintained crate

Additionally a comparison with those crates provides in my opinion at least a crude way to estimate how large the overhead introduced by diesel is compared to manually handling everything.

By default only the diesel benchmarks are build and executed. For all other benchmarks you need to specify their corresponding feature flags (depending on the crate, more than one, see the Readme for details)

Open Questions:

  • How to integrate this into our CI? (I think we should check that the diesel benchmarks still compile during normal CI and have some special @github-thing run-benches or so to get a diesel benchmark comparison between the current PR and the master branch?)
  • Are the benchmarks meaningful? Do we miss some important case?

cc @mehcode @pimeys @ivanceras @gwenn @sfackler @blackbeam as the corresponding benchmarks could also be interesting for your crates (If not, sorry for bother you in advance)

@weiznich weiznich requested a review from a team September 17, 2020 08:49
@weiznich weiznich changed the title Rework benchmarks [WIP] Rework benchmarks Sep 17, 2020
@weiznich
Copy link
Member Author

weiznich commented Sep 17, 2020

Preliminary results from my local system

Sqlite

Notable Results:

  • Using a boxed query has a measurable performance impact on sqlite, but only for really simple queries receiving almost no data
  • QueryableByName is slow compared to Queryable
  • Inserts are quite slow for diesel compared to rusqlite (factor 2-3 slower) We should have a look here what is causing this
  • rusqulite is consistently the fasted implementation, but only my a relative small margin in most scenarios
  • Both async implementations (quaint + sqlx) are consistently much slower for all query scenarios (3x-4x times slower). Either I've used them in the wrong way or using sqlite + async is a really bad idea.
  • rustorm is quite slow, especially for inserts as I've found no way to start/end a transaction to correctly perform "batch inserts"
Raw results
    Updating crates.io index
   Compiling diesel_bench v0.1.0 (/home/weiznich/Dokumente/rust/diesel/diesel_bench)
    Finished bench [optimized] target(s) in 1m 01s
     Running target/release/deps/benchmarks-06d6b2b213e3665d
bench_trivial_query/diesel/1
                        time:   [793.39 ns 811.93 ns 838.22 ns]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe
bench_trivial_query/diesel_boxed/1
                        time:   [1.5491 us 1.5567 us 1.5671 us]
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) high mild
  6 (6.00%) high severe
bench_trivial_query/diesel_queryable_by_name/1
                        time:   [3.7194 us 3.7516 us 3.7847 us]
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/rustorm/1
                        time:   [11.736 us 12.055 us 12.419 us]
Found 12 outliers among 100 measurements (12.00%)
  8 (8.00%) high mild
  4 (4.00%) high severe
bench_trivial_query/quaint/1
                        time:   [3.5990 us 3.8559 us 4.2968 us]
Found 14 outliers among 100 measurements (14.00%)
  4 (4.00%) high mild
  10 (10.00%) high severe
bench_trivial_query/sqlx_query_as_macro/1
                        time:   [8.8012 us 8.9377 us 9.1068 us]
Found 14 outliers among 100 measurements (14.00%)
  8 (8.00%) high mild
  6 (6.00%) high severe
bench_trivial_query/sqlx_query_from_row/1
                        time:   [9.0458 us 9.2443 us 9.4771 us]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/rusqlite_by_id/1
                        time:   [531.14 ns 539.99 ns 551.87 ns]
Found 11 outliers among 100 measurements (11.00%)
  3 (3.00%) high mild
  8 (8.00%) high severe
bench_trivial_query/rusqlite_by_name/1
                        time:   [669.09 ns 670.89 ns 673.16 ns]
Found 15 outliers among 100 measurements (15.00%)
  7 (7.00%) high mild
  8 (8.00%) high severe
bench_trivial_query/diesel/10
                        time:   [4.0845 us 4.1335 us 4.2056 us]
Found 16 outliers among 100 measurements (16.00%)
  1 (1.00%) low mild
  7 (7.00%) high mild
  8 (8.00%) high severe
bench_trivial_query/diesel_boxed/10
                        time:   [4.5763 us 4.6082 us 4.6488 us]
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe
bench_trivial_query/diesel_queryable_by_name/10
                        time:   [9.1567 us 9.3438 us 9.6772 us]
Found 15 outliers among 100 measurements (15.00%)
  4 (4.00%) high mild
  11 (11.00%) high severe
bench_trivial_query/rustorm/10
                        time:   [22.185 us 22.727 us 23.329 us]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/quaint/10
                        time:   [12.103 us 12.514 us 13.217 us]
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) high mild
  9 (9.00%) high severe
bench_trivial_query/sqlx_query_as_macro/10
                        time:   [23.386 us 23.705 us 24.117 us]
Found 14 outliers among 100 measurements (14.00%)
  3 (3.00%) high mild
  11 (11.00%) high severe
bench_trivial_query/sqlx_query_from_row/10
                        time:   [24.851 us 25.186 us 25.794 us]
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) low mild
  6 (6.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/rusqlite_by_id/10
                        time:   [3.2618 us 3.2699 us 3.2786 us]
Found 6 outliers among 100 measurements (6.00%)
  6 (6.00%) high severe
bench_trivial_query/rusqlite_by_name/10
                        time:   [4.7757 us 5.0665 us 5.3734 us]
Found 22 outliers among 100 measurements (22.00%)
  4 (4.00%) high mild
  18 (18.00%) high severe
bench_trivial_query/diesel/100
                        time:   [37.879 us 38.209 us 38.645 us]
Found 16 outliers among 100 measurements (16.00%)
  7 (7.00%) high mild
  9 (9.00%) high severe
bench_trivial_query/diesel_boxed/100
                        time:   [36.819 us 37.284 us 37.855 us]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe
bench_trivial_query/diesel_queryable_by_name/100
                        time:   [61.532 us 61.939 us 62.447 us]
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
  9 (9.00%) high severe
bench_trivial_query/rustorm/100
                        time:   [155.32 us 168.92 us 188.30 us]
Found 11 outliers among 100 measurements (11.00%)
  8 (8.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/quaint/100
                        time:   [101.75 us 103.03 us 104.82 us]
Found 16 outliers among 100 measurements (16.00%)
  7 (7.00%) high mild
  9 (9.00%) high severe
bench_trivial_query/sqlx_query_as_macro/100
                        time:   [170.04 us 171.99 us 174.06 us]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/sqlx_query_from_row/100
                        time:   [179.63 us 182.31 us 185.82 us]
Found 13 outliers among 100 measurements (13.00%)
  1 (1.00%) low mild
  12 (12.00%) high severe
bench_trivial_query/rusqlite_by_id/100
                        time:   [28.133 us 28.545 us 29.054 us]
Found 18 outliers among 100 measurements (18.00%)
  1 (1.00%) high mild
  17 (17.00%) high severe
bench_trivial_query/rusqlite_by_name/100
                        time:   [40.630 us 41.008 us 41.487 us]
Found 13 outliers among 100 measurements (13.00%)
  1 (1.00%) high mild
  12 (12.00%) high severe
bench_trivial_query/diesel/1000
                        time:   [358.88 us 369.42 us 382.76 us]
Found 18 outliers among 100 measurements (18.00%)
  5 (5.00%) high mild
  13 (13.00%) high severe
bench_trivial_query/diesel_boxed/1000
                        time:   [355.27 us 361.64 us 368.98 us]
Found 9 outliers among 100 measurements (9.00%)
  5 (5.00%) high mild
  4 (4.00%) high severe
bench_trivial_query/diesel_queryable_by_name/1000
                        time:   [617.94 us 634.27 us 654.52 us]
Found 15 outliers among 100 measurements (15.00%)
  6 (6.00%) high mild
  9 (9.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.7s or reduce sample count to 60.
bench_trivial_query/rustorm/1000
                        time:   [1.3685 ms 1.4268 ms 1.4965 ms]
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.4s or reduce sample count to 60.
bench_trivial_query/quaint/1000
                        time:   [994.99 us 1.0305 ms 1.0765 ms]
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 11.5s or reduce sample count to 40.
bench_trivial_query/sqlx_query_as_macro/1000
                        time:   [1.6993 ms 1.7232 ms 1.7502 ms]
Found 10 outliers among 100 measurements (10.00%)
  2 (2.00%) low mild
  7 (7.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 9.3s or reduce sample count to 50.
bench_trivial_query/sqlx_query_from_row/1000
                        time:   [1.7501 ms 1.7761 ms 1.8064 ms]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/rusqlite_by_id/1000
                        time:   [279.74 us 285.02 us 291.88 us]
Found 9 outliers among 100 measurements (9.00%)
  3 (3.00%) high mild
  6 (6.00%) high severe
bench_trivial_query/rusqlite_by_name/1000
                        time:   [434.55 us 452.79 us 473.66 us]

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 20.2s or reduce sample count to 30.
bench_trivial_query/diesel/10000
                        time:   [3.5909 ms 3.6355 ms 3.7085 ms]
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) low mild
  3 (3.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 17.3s or reduce sample count to 30.
bench_trivial_query/diesel_boxed/10000
                        time:   [3.4183 ms 3.4432 ms 3.4716 ms]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 28.5s or reduce sample count to 20.
bench_trivial_query/diesel_queryable_by_name/10000
                        time:   [5.5022 ms 5.6272 ms 5.8135 ms]
Found 16 outliers among 100 measurements (16.00%)
  4 (4.00%) high mild
  12 (12.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 60.0s or reduce sample count to 20.
bench_trivial_query/rustorm/10000
                        time:   [11.453 ms 11.763 ms 12.141 ms]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 51.7s or reduce sample count to 20.
bench_trivial_query/quaint/10000
                        time:   [9.3796 ms 9.4572 ms 9.5530 ms]
Found 27 outliers among 100 measurements (27.00%)
  16 (16.00%) low mild
  3 (3.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 81.9s or reduce sample count to 10.
bench_trivial_query/sqlx_query_as_macro/10000
                        time:   [15.810 ms 16.552 ms 17.735 ms]
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) low severe
  5 (5.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 84.8s or reduce sample count to 10.
bench_trivial_query/sqlx_query_from_row/10000
                        time:   [17.034 ms 17.280 ms 17.590 ms]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 17.9s or reduce sample count to 30.
bench_trivial_query/rusqlite_by_id/10000
                        time:   [2.9378 ms 2.9611 ms 2.9930 ms]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 20.4s or reduce sample count to 30.
bench_trivial_query/rusqlite_by_name/10000
                        time:   [4.2075 ms 4.3261 ms 4.4820 ms]
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe

bench_medium_complex_query/diesel/1
                        time:   [4.4917 us 4.5017 us 4.5138 us]
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) low severe
  1 (1.00%) high mild
  8 (8.00%) high severe
bench_medium_complex_query/diesel_boxed/1
                        time:   [7.2874 us 7.7847 us 8.8397 us]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/1
                        time:   [12.908 us 13.034 us 13.214 us]
Found 14 outliers among 100 measurements (14.00%)
  4 (4.00%) high mild
  10 (10.00%) high severe
bench_medium_complex_query/quaint/1
                        time:   [15.087 us 15.325 us 15.585 us]
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/1
                        time:   [12.673 us 12.903 us 13.171 us]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/sqlx_query_from_row/1
                        time:   [13.313 us 13.615 us 13.935 us]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/rustorm/1
                        time:   [20.902 us 21.419 us 22.005 us]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/rusqlite_by_id/1
                        time:   [2.9491 us 3.0322 us 3.1299 us]
Found 18 outliers among 100 measurements (18.00%)
  1 (1.00%) high mild
  17 (17.00%) high severe
bench_medium_complex_query/rusqlite_by_name/1
                        time:   [3.0827 us 3.1302 us 3.1993 us]
Found 12 outliers among 100 measurements (12.00%)
  6 (6.00%) high mild
  6 (6.00%) high severe
bench_medium_complex_query/diesel/10
                        time:   [7.8661 us 7.9005 us 7.9447 us]
Found 13 outliers among 100 measurements (13.00%)
  3 (3.00%) high mild
  10 (10.00%) high severe
bench_medium_complex_query/diesel_boxed/10
                        time:   [10.482 us 10.568 us 10.675 us]
Found 13 outliers among 100 measurements (13.00%)
  2 (2.00%) high mild
  11 (11.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/10
                        time:   [24.201 us 24.306 us 24.462 us]
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) low mild
  5 (5.00%) high severe
bench_medium_complex_query/quaint/10
                        time:   [33.665 us 34.072 us 34.684 us]
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/10
                        time:   [36.692 us 38.269 us 40.030 us]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
bench_medium_complex_query/sqlx_query_from_row/10
                        time:   [46.632 us 49.772 us 53.295 us]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/rustorm/10
                        time:   [45.762 us 46.878 us 48.101 us]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe
bench_medium_complex_query/rusqlite_by_id/10
                        time:   [7.8702 us 7.8952 us 7.9255 us]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/rusqlite_by_name/10
                        time:   [10.105 us 10.143 us 10.188 us]
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/diesel/100
                        time:   [46.733 us 47.353 us 48.171 us]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) high mild
  10 (10.00%) high severe
bench_medium_complex_query/diesel_boxed/100
                        time:   [49.757 us 50.041 us 50.352 us]
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/100
                        time:   [115.10 us 115.50 us 115.99 us]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/quaint/100
                        time:   [217.44 us 220.52 us 224.03 us]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/100
                        time:   [230.52 us 234.34 us 239.40 us]
Found 14 outliers among 100 measurements (14.00%)
  5 (5.00%) high mild
  9 (9.00%) high severe
bench_medium_complex_query/sqlx_query_from_row/100
                        time:   [263.26 us 266.41 us 270.31 us]
Found 16 outliers among 100 measurements (16.00%)
  8 (8.00%) high mild
  8 (8.00%) high severe
bench_medium_complex_query/rustorm/100
                        time:   [321.61 us 332.66 us 348.82 us]
Found 8 outliers among 100 measurements (8.00%)
  8 (8.00%) high mild
bench_medium_complex_query/rusqlite_by_id/100
                        time:   [55.690 us 56.153 us 56.750 us]
Found 12 outliers among 100 measurements (12.00%)
  2 (2.00%) high mild
  10 (10.00%) high severe
bench_medium_complex_query/rusqlite_by_name/100
                        time:   [84.404 us 88.578 us 93.607 us]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe
bench_medium_complex_query/diesel/1000
                        time:   [457.08 us 458.31 us 459.81 us]
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) low mild
  4 (4.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/diesel_boxed/1000
                        time:   [461.33 us 464.19 us 467.90 us]
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.5s or reduce sample count to 60.
bench_medium_complex_query/diesel_queryable_by_name/1000
                        time:   [1.0772 ms 1.0812 ms 1.0861 ms]
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) low severe
  2 (2.00%) low mild
  1 (1.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 10.3s or reduce sample count to 40.
bench_medium_complex_query/quaint/1000
                        time:   [2.1538 ms 2.2517 ms 2.3536 ms]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) high mild
  10 (10.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 14.6s or reduce sample count to 40.
bench_medium_complex_query/sqlx_query_as_macro/1000
                        time:   [2.1788 ms 2.2037 ms 2.2445 ms]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 12.6s or reduce sample count to 40.
bench_medium_complex_query/sqlx_query_from_row/1000
                        time:   [2.4794 ms 2.5303 ms 2.6236 ms]
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 12.3s or reduce sample count to 40.
bench_medium_complex_query/rustorm/1000
                        time:   [2.5839 ms 2.6142 ms 2.6517 ms]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe
bench_medium_complex_query/rusqlite_by_id/1000
                        time:   [528.05 us 536.12 us 546.58 us]
Found 21 outliers among 100 measurements (21.00%)
  4 (4.00%) high mild
  17 (17.00%) high severe
bench_medium_complex_query/rusqlite_by_name/1000
                        time:   [749.88 us 773.82 us 807.84 us]
Found 16 outliers among 100 measurements (16.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
  13 (13.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 22.8s or reduce sample count to 30.
bench_medium_complex_query/diesel/10000
                        time:   [4.6012 ms 4.6521 ms 4.7244 ms]
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 23.2s or reduce sample count to 30.
bench_medium_complex_query/diesel_boxed/10000
                        time:   [4.5777 ms 4.6304 ms 4.7232 ms]
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 61.7s or reduce sample count to 10.
bench_medium_complex_query/diesel_queryable_by_name/10000
                        time:   [10.538 ms 10.637 ms 10.756 ms]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 115.0s or reduce sample count to 10.
bench_medium_complex_query/quaint/10000
                        time:   [23.137 ms 23.493 ms 23.890 ms]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 147.1s or reduce sample count to 10.
bench_medium_complex_query/sqlx_query_as_macro/10000
                        time:   [21.836 ms 22.157 ms 22.568 ms]
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 123.2s or reduce sample count to 10.
bench_medium_complex_query/sqlx_query_from_row/10000
                        time:   [24.813 ms 25.144 ms 25.523 ms]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 129.0s or reduce sample count to 10.
bench_medium_complex_query/rustorm/10000
                        time:   [24.800 ms 25.156 ms 25.552 ms]
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 27.0s or reduce sample count to 30.
bench_medium_complex_query/rusqlite_by_id/10000
                        time:   [5.1568 ms 5.3455 ms 5.5789 ms]
Found 16 outliers among 100 measurements (16.00%)
  4 (4.00%) high mild
  12 (12.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 36.1s or reduce sample count to 20.
bench_medium_complex_query/rusqlite_by_name/10000
                        time:   [7.1539 ms 7.1913 ms 7.2345 ms]
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) high mild
  6 (6.00%) high severe

bench_loading_associations_sequentially/diesel/bench_loading_associations_sequentially
                        time:   [587.85 us 614.43 us 648.10 us]
Found 13 outliers among 100 measurements (13.00%)
  3 (3.00%) high mild
  10 (10.00%) high severe
bench_loading_associations_sequentially/rusqlite
                        time:   [519.26 us 534.34 us 555.42 us]
Found 15 outliers among 100 measurements (15.00%)
  4 (4.00%) high mild
  11 (11.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 12.3s or reduce sample count to 40.
bench_loading_associations_sequentially/sqlx
                        time:   [2.4080 ms 2.4333 ms 2.4627 ms]
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 7.9s or reduce sample count to 50.
bench_loading_associations_sequentially/rustorm
                        time:   [1.7620 ms 1.8275 ms 1.9094 ms]
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 6.4s or reduce sample count to 60.
bench_loading_associations_sequentially/quaint
                        time:   [1.2449 ms 1.2575 ms 1.2734 ms]
Found 16 outliers among 100 measurements (16.00%)
  3 (3.00%) high mild
  13 (13.00%) high severe

bench_insert/diesel/1   time:   [7.5772 us 7.6226 us 7.6767 us]
Found 15 outliers among 100 measurements (15.00%)
  1 (1.00%) low mild
  8 (8.00%) high mild
  6 (6.00%) high severe
bench_insert/sqlx/1     time:   [23.275 us 23.642 us 24.074 us]
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe
bench_insert/quaint/1   time:   [8.2980 us 8.3510 us 8.4099 us]
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 34.3s or reduce sample count to 20.
bench_insert/rustorm/1  time:   [4.5098 ms 4.5737 ms 4.6441 ms]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
bench_insert/rusqlite/1 time:   [5.9201 us 5.9845 us 6.0755 us]
Found 13 outliers among 100 measurements (13.00%)
  7 (7.00%) high mild
  6 (6.00%) high severe
bench_insert/diesel/10  time:   [42.591 us 42.895 us 43.296 us]
Found 14 outliers among 100 measurements (14.00%)
  2 (2.00%) high mild
  12 (12.00%) high severe
bench_insert/sqlx/10    time:   [86.083 us 87.432 us 89.067 us]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
bench_insert/quaint/10  time:   [43.998 us 44.626 us 45.352 us]
Found 13 outliers among 100 measurements (13.00%)
  6 (6.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 268.0s or reduce sample count to 10.
bench_insert/rustorm/10 time:   [96.233 ms 101.00 ms 104.85 ms]
bench_insert/rusqlite/10
                        time:   [15.370 us 15.441 us 15.545 us]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) low severe
  2 (2.00%) high mild
  8 (8.00%) high severe
bench_insert/diesel/25  time:   [108.27 us 109.54 us 111.06 us]
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) high mild
  11 (11.00%) high severe
bench_insert/sqlx/25    time:   [190.27 us 192.37 us 194.62 us]
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) high mild
  6 (6.00%) high severe
bench_insert/quaint/25  time:   [99.794 us 100.64 us 101.69 us]
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 1112.0s or reduce sample count to 10.
bench_insert/rustorm/25 time:   [268.11 ms 274.07 ms 278.92 ms]
bench_insert/rusqlite/25
                        time:   [31.120 us 31.239 us 31.362 us]
Found 9 outliers among 100 measurements (9.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
  6 (6.00%) high severe
bench_insert/diesel/50  time:   [207.84 us 221.51 us 246.63 us]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) high mild
  9 (9.00%) high severe
bench_insert/sqlx/50    time:   [363.24 us 368.83 us 375.66 us]
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe
bench_insert/quaint/50  time:   [195.30 us 197.55 us 200.04 us]
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 1820.8s or reduce sample count to 10.
bench_insert/rustorm/50 time:   [573.20 ms 581.18 ms 587.66 ms]
bench_insert/rusqlite/50
                        time:   [61.742 us 64.365 us 67.658 us]
Found 17 outliers among 100 measurements (17.00%)
  4 (4.00%) high mild
  13 (13.00%) high severe
bench_insert/diesel/100 time:   [443.65 us 463.25 us 489.06 us]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
bench_insert/sqlx/100   time:   [728.11 us 742.21 us 764.63 us]
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) high mild
  5 (5.00%) high severe
bench_insert/quaint/100 time:   [387.87 us 398.43 us 419.42 us]
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 4236.2s or reduce sample count to 10.
bench_insert/rustorm/100
                        time:   [1.2169 s 1.2274 s 1.2363 s]
Found 18 outliers among 100 measurements (18.00%)
  18 (18.00%) low mild
bench_insert/rusqlite/100
                        time:   [127.23 us 135.09 us 144.01 us]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe

Postgresql

Notable Results:

  • Using boxed queries seems to have a nearly not measurable impact on the benchmark results (about 2 us, compared to >80us that a simple query returning a single element needs)
  • For small return sets QueryableByName seems to be significantly slower than Queryable (~ factor 2), whereas for large result sets the difference is much smaller. For postgres the benchmarks do not show such a difference.
  • For small result sets (1-10 elements) postgres seems to be the fastest, for larger ones diesel seems to be faster. This changes for the joined query benchmark. (Probably related to that we use the a heap allocated value with dynamic dispatch there to signal null values?)
  • For inserts everything seems to be quite close together, for small size sqlx, quaint and diesel are near together. For larger sets posqres closes the gap and diesel seems to get a bit slower. (Not sure if that differences are significant in any way, probably that's all noise)
  • For queries sqlx, quaint and rustorm all seems to be consistently slower than both diesel and postgres (~2-4 times). Quaint seems to be the fasted one of those three solutions. For sqlx the gap to diesel and postgres seems to grow with increasing size of the result set. For the bench_loading_associations_sequentially case quaint and sqlx are ~4 times slower than the diesel or postgres version.
Raw results
    Updating crates.io index
    Updating git repository `https://github.com/pimeys/rust-postgres`
    Finished bench [optimized] target(s) in 3.87s
     Running target/release/deps/benchmarks-d0a1989523b68b7a
bench_trivial_query/diesel/1
                        time:   [77.381 us 80.702 us 84.530 us]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe
bench_trivial_query/diesel_boxed/1
                        time:   [79.293 us 83.389 us 88.056 us]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe
bench_trivial_query/diesel_queryable_by_name/1
                        time:   [175.43 us 183.47 us 192.72 us]
Found 8 outliers among 100 measurements (8.00%)
  8 (8.00%) high mild
bench_trivial_query/rustorm/1
                        time:   [179.98 us 187.11 us 195.63 us]
Found 14 outliers among 100 measurements (14.00%)
  14 (14.00%) high mild
bench_trivial_query/quaint/1
                        time:   [138.83 us 146.16 us 154.76 us]
Found 12 outliers among 100 measurements (12.00%)
  9 (9.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/sqlx_query_as_macro/1
                        time:   [100.20 us 106.76 us 114.39 us]
Found 16 outliers among 100 measurements (16.00%)
  6 (6.00%) high mild
  10 (10.00%) high severe
bench_trivial_query/sqlx_query_from_row/1
                        time:   [109.37 us 114.96 us 121.40 us]
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe
bench_trivial_query/postgres_by_id/1
                        time:   [73.740 us 78.105 us 83.213 us]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
bench_trivial_query/postgres_by_name/1
                        time:   [75.190 us 79.580 us 85.053 us]
Found 10 outliers among 100 measurements (10.00%)
  9 (9.00%) high mild
  1 (1.00%) high severe
bench_trivial_query/diesel/10
                        time:   [88.624 us 92.662 us 97.576 us]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
bench_trivial_query/diesel_boxed/10
                        time:   [91.423 us 94.611 us 98.355 us]
Found 11 outliers among 100 measurements (11.00%)
  9 (9.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/diesel_queryable_by_name/10
                        time:   [191.36 us 199.19 us 208.13 us]
Found 6 outliers among 100 measurements (6.00%)
  6 (6.00%) high mild
bench_trivial_query/rustorm/10
                        time:   [231.23 us 252.43 us 276.33 us]
Found 12 outliers among 100 measurements (12.00%)
  12 (12.00%) high mild
bench_trivial_query/quaint/10
                        time:   [161.02 us 169.98 us 181.00 us]
Found 14 outliers among 100 measurements (14.00%)
  11 (11.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/sqlx_query_as_macro/10
                        time:   [140.37 us 147.33 us 155.45 us]
Found 8 outliers among 100 measurements (8.00%)
  7 (7.00%) high mild
  1 (1.00%) high severe
bench_trivial_query/sqlx_query_from_row/10
                        time:   [144.50 us 151.33 us 159.16 us]
Found 13 outliers among 100 measurements (13.00%)
  7 (7.00%) high mild
  6 (6.00%) high severe
bench_trivial_query/postgres_by_id/10
                        time:   [92.247 us 97.419 us 103.28 us]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild
bench_trivial_query/postgres_by_name/10
                        time:   [91.784 us 97.541 us 104.28 us]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
bench_trivial_query/diesel/100
                        time:   [174.59 us 184.80 us 196.47 us]
Found 10 outliers among 100 measurements (10.00%)
  10 (10.00%) high mild
bench_trivial_query/diesel_boxed/100
                        time:   [179.63 us 189.38 us 200.48 us]
Found 12 outliers among 100 measurements (12.00%)
  8 (8.00%) high mild
  4 (4.00%) high severe
bench_trivial_query/diesel_queryable_by_name/100
                        time:   [299.40 us 316.06 us 335.18 us]
Found 8 outliers among 100 measurements (8.00%)
  8 (8.00%) high mild
bench_trivial_query/rustorm/100
                        time:   [428.15 us 458.20 us 493.19 us]
Found 13 outliers among 100 measurements (13.00%)
  11 (11.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/quaint/100
                        time:   [278.66 us 288.55 us 300.19 us]
Found 11 outliers among 100 measurements (11.00%)
  10 (10.00%) high mild
  1 (1.00%) high severe
bench_trivial_query/sqlx_query_as_macro/100
                        time:   [391.10 us 406.65 us 424.47 us]
Found 15 outliers among 100 measurements (15.00%)
  15 (15.00%) high mild
bench_trivial_query/sqlx_query_from_row/100
                        time:   [435.57 us 454.89 us 477.54 us]
Found 10 outliers among 100 measurements (10.00%)
  10 (10.00%) high mild
bench_trivial_query/postgres_by_id/100
                        time:   [225.57 us 238.23 us 252.34 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
bench_trivial_query/postgres_by_name/100
                        time:   [240.29 us 254.95 us 271.42 us]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild
bench_trivial_query/diesel/1000
                        time:   [764.35 us 794.61 us 827.51 us]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe
bench_trivial_query/diesel_boxed/1000
                        time:   [742.62 us 777.78 us 820.85 us]
Found 10 outliers among 100 measurements (10.00%)
  6 (6.00%) high mild
  4 (4.00%) high severe
bench_trivial_query/diesel_queryable_by_name/1000
                        time:   [891.27 us 915.62 us 943.34 us]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 8.7s or reduce sample count to 50.
bench_trivial_query/rustorm/1000
                        time:   [1.6972 ms 1.7371 ms 1.7837 ms]
Found 10 outliers among 100 measurements (10.00%)
  2 (2.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.7s or reduce sample count to 60.
bench_trivial_query/quaint/1000
                        time:   [1.2074 ms 1.2482 ms 1.2909 ms]
Found 9 outliers among 100 measurements (9.00%)
  3 (3.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 10.0s or reduce sample count to 40.
bench_trivial_query/sqlx_query_as_macro/1000
                        time:   [2.0992 ms 2.1494 ms 2.2116 ms]
Found 11 outliers among 100 measurements (11.00%)
  3 (3.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 10.8s or reduce sample count to 40.
bench_trivial_query/sqlx_query_from_row/1000
                        time:   [2.2546 ms 2.2975 ms 2.3479 ms]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.3s or reduce sample count to 60.
bench_trivial_query/postgres_by_id/1000
                        time:   [1.1568 ms 1.2486 ms 1.3607 ms]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.2s or reduce sample count to 60.
bench_trivial_query/postgres_by_name/1000
                        time:   [1.1504 ms 1.1861 ms 1.2246 ms]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 30.0s or reduce sample count to 20.
bench_trivial_query/diesel/10000
                        time:   [5.9168 ms 6.0419 ms 6.2012 ms]
Found 13 outliers among 100 measurements (13.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild
  11 (11.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 28.7s or reduce sample count to 20.
bench_trivial_query/diesel_boxed/10000
                        time:   [5.9696 ms 6.1920 ms 6.4617 ms]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 36.0s or reduce sample count to 20.
bench_trivial_query/diesel_queryable_by_name/10000
                        time:   [6.8018 ms 6.9528 ms 7.1487 ms]
Found 10 outliers among 100 measurements (10.00%)
  2 (2.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 74.3s or reduce sample count to 10.
bench_trivial_query/rustorm/10000
                        time:   [13.790 ms 13.973 ms 14.265 ms]
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 48.8s or reduce sample count to 20.
bench_trivial_query/quaint/10000
                        time:   [9.9044 ms 10.224 ms 10.627 ms]
Found 9 outliers among 100 measurements (9.00%)
  1 (1.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 85.7s or reduce sample count to 10.
bench_trivial_query/sqlx_query_as_macro/10000
                        time:   [16.960 ms 17.166 ms 17.445 ms]
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 94.9s or reduce sample count to 10.
bench_trivial_query/sqlx_query_from_row/10000
                        time:   [18.599 ms 18.778 ms 18.988 ms]
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 41.1s or reduce sample count to 20.
bench_trivial_query/postgres_by_id/10000
                        time:   [7.7936 ms 7.9152 ms 8.0660 ms]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 41.6s or reduce sample count to 20.
bench_trivial_query/postgres_by_name/10000
                        time:   [8.1742 ms 8.2873 ms 8.4129 ms]
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild
  4 (4.00%) high severe

bench_medium_complex_query/diesel/1
                        time:   [104.07 us 108.54 us 113.85 us]
Found 11 outliers among 100 measurements (11.00%)
  8 (8.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/diesel_boxed/1
                        time:   [110.66 us 115.52 us 121.34 us]
Found 12 outliers among 100 measurements (12.00%)
  8 (8.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/1
                        time:   [298.13 us 308.75 us 321.16 us]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/quaint/1
                        time:   [174.07 us 181.24 us 189.69 us]
Found 9 outliers among 100 measurements (9.00%)
  3 (3.00%) high mild
  6 (6.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/1
                        time:   [134.68 us 143.89 us 155.42 us]
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe
bench_medium_complex_query/sqlx_query_from_row/1
                        time:   [137.16 us 142.79 us 149.32 us]
Found 12 outliers among 100 measurements (12.00%)
  8 (8.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/rustorm/1
                        time:   [308.41 us 318.62 us 330.18 us]
Found 8 outliers among 100 measurements (8.00%)
  7 (7.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/postgres_by_id/1
                        time:   [96.023 us 100.61 us 105.93 us]
Found 9 outliers among 100 measurements (9.00%)
  9 (9.00%) high mild
bench_medium_complex_query/postgres_by_name/1
                        time:   [96.555 us 101.72 us 107.82 us]
Found 13 outliers among 100 measurements (13.00%)
  10 (10.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/diesel/10
                        time:   [122.23 us 127.89 us 134.22 us]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe
bench_medium_complex_query/diesel_boxed/10
                        time:   [127.03 us 132.73 us 139.59 us]
Found 12 outliers among 100 measurements (12.00%)
  7 (7.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/10
                        time:   [343.60 us 357.44 us 373.26 us]
Found 12 outliers among 100 measurements (12.00%)
  11 (11.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/quaint/10
                        time:   [208.73 us 218.11 us 229.50 us]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/10
                        time:   [192.54 us 205.63 us 220.69 us]
Found 8 outliers among 100 measurements (8.00%)
  7 (7.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/sqlx_query_from_row/10
                        time:   [193.72 us 203.82 us 215.82 us]
Found 11 outliers among 100 measurements (11.00%)
  10 (10.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/rustorm/10
                        time:   [374.18 us 387.87 us 404.41 us]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/postgres_by_id/10
                        time:   [123.68 us 130.97 us 139.40 us]
Found 8 outliers among 100 measurements (8.00%)
  8 (8.00%) high mild
bench_medium_complex_query/postgres_by_name/10
                        time:   [123.17 us 130.37 us 138.98 us]
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/diesel/100
                        time:   [280.24 us 291.39 us 304.56 us]
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/diesel_boxed/100
                        time:   [283.73 us 295.82 us 310.26 us]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/100
                        time:   [546.40 us 565.91 us 588.94 us]
Found 10 outliers among 100 measurements (10.00%)
  9 (9.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/quaint/100
                        time:   [464.09 us 496.51 us 538.92 us]
Found 10 outliers among 100 measurements (10.00%)
  8 (8.00%) high mild
  2 (2.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/100
                        time:   [547.87 us 574.50 us 604.87 us]
Found 16 outliers among 100 measurements (16.00%)
  11 (11.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/sqlx_query_from_row/100
                        time:   [596.41 us 621.87 us 652.45 us]
Found 7 outliers among 100 measurements (7.00%)
  6 (6.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/rustorm/100
                        time:   [860.15 us 917.33 us 982.93 us]
Found 10 outliers among 100 measurements (10.00%)
  9 (9.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/postgres_by_id/100
                        time:   [365.83 us 392.73 us 422.68 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
bench_medium_complex_query/postgres_by_name/100
                        time:   [327.18 us 350.80 us 378.09 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 8.1s or reduce sample count to 50.
bench_medium_complex_query/diesel/1000
                        time:   [1.6823 ms 1.7492 ms 1.8305 ms]
Found 14 outliers among 100 measurements (14.00%)
  8 (8.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 8.3s or reduce sample count to 50.
bench_medium_complex_query/diesel_boxed/1000
                        time:   [1.6887 ms 1.7305 ms 1.7824 ms]
Found 14 outliers among 100 measurements (14.00%)
  4 (4.00%) high mild
  10 (10.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 8.2s or reduce sample count to 50.
bench_medium_complex_query/diesel_queryable_by_name/1000
                        time:   [1.6360 ms 1.6731 ms 1.7156 ms]
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 10.0s or reduce sample count to 40.
bench_medium_complex_query/quaint/1000
                        time:   [2.1642 ms 2.2608 ms 2.3694 ms]
Found 10 outliers among 100 measurements (10.00%)
  6 (6.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 13.8s or reduce sample count to 40.
bench_medium_complex_query/sqlx_query_as_macro/1000
                        time:   [2.7676 ms 2.8274 ms 2.9076 ms]
Found 12 outliers among 100 measurements (12.00%)
  3 (3.00%) high mild
  9 (9.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 15.9s or reduce sample count to 30.
bench_medium_complex_query/sqlx_query_from_row/1000
                        time:   [3.0121 ms 3.0768 ms 3.1583 ms]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) high mild
  9 (9.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 16.4s or reduce sample count to 30.
bench_medium_complex_query/rustorm/1000
                        time:   [3.2573 ms 3.3378 ms 3.4308 ms]
Found 11 outliers among 100 measurements (11.00%)
  3 (3.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 6.6s or reduce sample count to 60.
bench_medium_complex_query/postgres_by_id/1000
                        time:   [1.3830 ms 1.4344 ms 1.4937 ms]
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 6.8s or reduce sample count to 60.
bench_medium_complex_query/postgres_by_name/1000
                        time:   [1.4004 ms 1.4327 ms 1.4697 ms]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 105.2s or reduce sample count to 10.
bench_medium_complex_query/diesel/10000
                        time:   [19.027 ms 19.488 ms 20.036 ms]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 96.0s or reduce sample count to 10.
bench_medium_complex_query/diesel_boxed/10000
                        time:   [18.400 ms 18.638 ms 18.960 ms]
Found 12 outliers among 100 measurements (12.00%)
  3 (3.00%) high mild
  9 (9.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 64.1s or reduce sample count to 10.
bench_medium_complex_query/diesel_queryable_by_name/10000
                        time:   [12.941 ms 13.226 ms 13.570 ms]
Found 19 outliers among 100 measurements (19.00%)
  1 (1.00%) low mild
  5 (5.00%) high mild
  13 (13.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 93.9s or reduce sample count to 10.
bench_medium_complex_query/quaint/10000
                        time:   [18.847 ms 19.216 ms 19.737 ms]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 121.7s or reduce sample count to 10.
bench_medium_complex_query/sqlx_query_as_macro/10000
                        time:   [23.301 ms 23.615 ms 23.968 ms]
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 131.2s or reduce sample count to 10.
bench_medium_complex_query/sqlx_query_from_row/10000
                        time:   [25.626 ms 25.904 ms 26.235 ms]
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 136.5s or reduce sample count to 10.
bench_medium_complex_query/rustorm/10000
                        time:   [26.316 ms 26.623 ms 27.016 ms]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 56.4s or reduce sample count to 20.
bench_medium_complex_query/postgres_by_id/10000
                        time:   [10.981 ms 11.205 ms 11.480 ms]
Found 8 outliers among 100 measurements (8.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 59.6s or reduce sample count to 20.
bench_medium_complex_query/postgres_by_name/10000
                        time:   [11.420 ms 11.640 ms 11.914 ms]
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) high mild
  4 (4.00%) high severe


Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 197.9s or reduce sample count to 10.
bench_loading_associations_sequentially/diesel/bench_loading_associations_sequentially
                        time:   [35.139 ms 35.423 ms 35.792 ms]
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 180.4s or reduce sample count to 10.
bench_loading_associations_sequentially/postgres
                        time:   [35.979 ms 36.271 ms 36.612 ms]
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 522.6s or reduce sample count to 10.
bench_loading_associations_sequentially/sqlx
                        time:   [168.77 ms 169.94 ms 171.00 ms]
Found 12 outliers among 100 measurements (12.00%)
  8 (8.00%) low severe
  4 (4.00%) low mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 222.9s or reduce sample count to 10.
bench_loading_associations_sequentially/rustorm
                        time:   [43.987 ms 44.438 ms 44.979 ms]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) high mild
  10 (10.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 533.0s or reduce sample count to 10.
bench_loading_associations_sequentially/quaint
                        time:   [169.09 ms 172.39 ms 176.52 ms]
Found 16 outliers among 100 measurements (16.00%)
  7 (7.00%) low severe
  5 (5.00%) low mild
  2 (2.00%) high mild
  2 (2.00%) high severe


Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 30.2s or reduce sample count to 20.
bench_insert/diesel/1   time:   [5.7174 ms 5.7799 ms 5.8441 ms]
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) low severe
  1 (1.00%) low mild
  2 (2.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 29.7s or reduce sample count to 20.
bench_insert/sqlx/1     time:   [5.1859 ms 5.3168 ms 5.4395 ms]
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) low mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 29.0s or reduce sample count to 20.
bench_insert/quaint/1   time:   [5.5032 ms 5.5848 ms 5.6671 ms]
Found 18 outliers among 100 measurements (18.00%)
  3 (3.00%) low severe
  4 (4.00%) low mild
  6 (6.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 30.3s or reduce sample count to 20.
bench_insert/rustorm/1  time:   [7.1195 ms 7.3951 ms 7.6295 ms]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 39.9s or reduce sample count to 20.
bench_insert/postgres/1 time:   [9.4830 ms 9.8448 ms 10.160 ms]

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 53.5s or reduce sample count to 20.
bench_insert/diesel/10  time:   [10.761 ms 10.975 ms 11.179 ms]
Found 11 outliers among 100 measurements (11.00%)
  8 (8.00%) low mild
  3 (3.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 53.1s or reduce sample count to 20.
bench_insert/sqlx/10    time:   [10.525 ms 10.674 ms 10.804 ms]
Found 8 outliers among 100 measurements (8.00%)
  1 (1.00%) low severe
  3 (3.00%) low mild
  4 (4.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 52.1s or reduce sample count to 20.
bench_insert/quaint/10  time:   [11.123 ms 11.333 ms 11.567 ms]
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) low severe
  1 (1.00%) low mild
  7 (7.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 54.4s or reduce sample count to 20.
bench_insert/rustorm/10 time:   [11.787 ms 12.129 ms 12.471 ms]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) low mild
  3 (3.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 59.9s or reduce sample count to 20.
bench_insert/postgres/10
                        time:   [11.597 ms 11.762 ms 11.947 ms]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) low mild
  2 (2.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 62.5s or reduce sample count to 10.
bench_insert/diesel/25  time:   [11.546 ms 11.784 ms 12.002 ms]
Found 10 outliers among 100 measurements (10.00%)
  2 (2.00%) low severe
  2 (2.00%) low mild
  5 (5.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 51.7s or reduce sample count to 20.
bench_insert/sqlx/25    time:   [11.090 ms 11.226 ms 11.364 ms]
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) low severe
  4 (4.00%) low mild
  1 (1.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 58.3s or reduce sample count to 20.
bench_insert/quaint/25  time:   [11.247 ms 11.403 ms 11.553 ms]
Found 13 outliers among 100 measurements (13.00%)
  2 (2.00%) low severe
  4 (4.00%) low mild
  5 (5.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 59.6s or reduce sample count to 20.
bench_insert/rustorm/25 time:   [11.989 ms 12.223 ms 12.521 ms]
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 59.7s or reduce sample count to 20.
bench_insert/postgres/25
                        time:   [11.735 ms 11.831 ms 11.923 ms]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) low mild
  1 (1.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 61.0s or reduce sample count to 10.
bench_insert/diesel/50  time:   [12.620 ms 12.801 ms 12.965 ms]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) low severe
  2 (2.00%) low mild
  1 (1.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 60.4s or reduce sample count to 10.
bench_insert/sqlx/50    time:   [11.683 ms 11.951 ms 12.211 ms]
Found 15 outliers among 100 measurements (15.00%)
  4 (4.00%) low severe
  4 (4.00%) low mild
  6 (6.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 60.9s or reduce sample count to 10.
bench_insert/quaint/50  time:   [12.003 ms 12.224 ms 12.462 ms]
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) low mild
  4 (4.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 66.6s or reduce sample count to 10.
bench_insert/rustorm/50 time:   [12.861 ms 13.156 ms 13.404 ms]
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) low severe
  2 (2.00%) low mild
  3 (3.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 57.8s or reduce sample count to 20.
bench_insert/postgres/50
                        time:   [12.184 ms 12.413 ms 12.619 ms]
Found 11 outliers among 100 measurements (11.00%)
  3 (3.00%) low severe
  1 (1.00%) low mild
  3 (3.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 69.4s or reduce sample count to 10.
bench_insert/diesel/100 time:   [14.472 ms 14.769 ms 15.033 ms]
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) low severe
  3 (3.00%) low mild
  3 (3.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 66.1s or reduce sample count to 10.
bench_insert/sqlx/100   time:   [13.311 ms 13.583 ms 13.938 ms]
Found 14 outliers among 100 measurements (14.00%)
  2 (2.00%) low severe
  6 (6.00%) low mild
  2 (2.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 66.8s or reduce sample count to 10.
bench_insert/quaint/100 time:   [13.361 ms 13.626 ms 13.866 ms]
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) low severe
  2 (2.00%) low mild
  2 (2.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 76.7s or reduce sample count to 10.
bench_insert/rustorm/100
                        time:   [15.084 ms 15.444 ms 15.752 ms]
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) low severe
  3 (3.00%) low mild
  3 (3.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 67.1s or reduce sample count to 10.
bench_insert/postgres/100
                        time:   [14.333 ms 14.652 ms 14.954 ms]
Found 13 outliers among 100 measurements (13.00%)
  6 (6.00%) low severe
  3 (3.00%) low mild
  1 (1.00%) high mild
  3 (3.00%) high severe

Mysql

Notable Results:

  • At least for queries returning only a small amount of data using a unboxed diesel query seems to be significant faster than using a boxed query
  • QueryableByName is significantly slower than Queryable. As I cannot observe this difference between the different mysql benchmark implementations, that seems to be caused by diesels implementation of NamedRow.
  • Small size inserts for diesel are faster than any other implementation, while large size inserts are not as fast as the fastest implementation provided by the other crates (sqlx). As a blind guess I would say that we have some inefficiency around binding a relative large number of values to a query.
  • For queries sqlx and quaint are consistently slower. For small return sets the gap seems to be around factor 2, while for large ones it increases up to factor 12.
  • rustorm and mysql are nearly as fast as diesel for small return sets, while there is a significant gap (around factor 3 for mysql, around factor 10 for rustorm) for large return sets. The last two points seems to indicate that somehow diesels/libmysqlclient's handling of database return values is much more efficient that anything implemented by any of the rust implementations. I would call this a major blocker for the adoption of a pure rust diesel-mysql connection.
  • rustorm has a broken insert implementation for mysql, therefore I needed to use plain sql.
Raw results
    Finished bench [optimized] target(s) in 2.07s
     Running target/release/deps/benchmarks-47e0f53da8a74725
bench_trivial_query/diesel/1
                        time:   [26.213 us 28.549 us 31.228 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
bench_trivial_query/diesel_boxed/1
                        time:   [35.225 us 40.825 us 47.027 us]
bench_trivial_query/diesel_queryable_by_name/1
                        time:   [83.747 us 93.194 us 103.61 us]
bench_trivial_query/rustorm/1
                        time:   [31.362 us 34.312 us 37.556 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
bench_trivial_query/quaint/1
                        time:   [70.741 us 79.900 us 90.044 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
bench_trivial_query/sqlx_query_as_macro/1
                        time:   [88.210 us 98.834 us 110.91 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
bench_trivial_query/sqlx_query_from_row/1
                        time:   [86.994 us 96.839 us 107.91 us]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
bench_trivial_query/mysql_by_id/1
                        time:   [28.206 us 31.519 us 35.163 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe
bench_trivial_query/mysql_by_name/1
                        time:   [27.706 us 30.686 us 33.821 us]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
bench_trivial_query/diesel/10
                        time:   [47.484 us 53.153 us 59.553 us]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/diesel_boxed/10
                        time:   [48.532 us 54.663 us 61.703 us]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/diesel_queryable_by_name/10
                        time:   [114.04 us 124.82 us 137.30 us]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
bench_trivial_query/rustorm/10
                        time:   [57.814 us 62.491 us 67.722 us]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe
bench_trivial_query/quaint/10
                        time:   [112.26 us 125.25 us 140.01 us]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
bench_trivial_query/sqlx_query_as_macro/10
                        time:   [183.42 us 204.71 us 228.62 us]
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/sqlx_query_from_row/10
                        time:   [179.49 us 198.44 us 219.50 us]
Found 10 outliers among 100 measurements (10.00%)
  7 (7.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/mysql_by_id/10
                        time:   [49.618 us 55.045 us 61.227 us]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/mysql_by_name/10
                        time:   [49.639 us 55.310 us 61.697 us]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/diesel/100
                        time:   [83.660 us 91.797 us 101.39 us]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/diesel_boxed/100
                        time:   [87.078 us 94.015 us 101.92 us]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/diesel_queryable_by_name/100
                        time:   [160.45 us 175.53 us 192.92 us]
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe
bench_trivial_query/rustorm/100
                        time:   [223.06 us 238.58 us 256.83 us]
Found 15 outliers among 100 measurements (15.00%)
  9 (9.00%) high mild
  6 (6.00%) high severe
bench_trivial_query/quaint/100
                        time:   [301.55 us 325.87 us 353.42 us]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/sqlx_query_as_macro/100
                        time:   [576.78 us 616.68 us 660.23 us]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe
bench_trivial_query/sqlx_query_from_row/100
                        time:   [602.20 us 640.11 us 683.20 us]
Found 13 outliers among 100 measurements (13.00%)
  8 (8.00%) high mild
  5 (5.00%) high severe
bench_trivial_query/mysql_by_id/100
                        time:   [124.31 us 133.60 us 144.31 us]
Found 12 outliers among 100 measurements (12.00%)
  6 (6.00%) high mild
  6 (6.00%) high severe
bench_trivial_query/mysql_by_name/100
                        time:   [137.61 us 151.93 us 169.10 us]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
bench_trivial_query/diesel/1000
                        time:   [357.36 us 379.14 us 403.84 us]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/diesel_boxed/1000
                        time:   [363.74 us 380.41 us 399.23 us]
Found 13 outliers among 100 measurements (13.00%)
  5 (5.00%) high mild
  8 (8.00%) high severe
bench_trivial_query/diesel_queryable_by_name/1000
                        time:   [486.09 us 516.76 us 551.84 us]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.7s or reduce sample count to 60.
bench_trivial_query/rustorm/1000
                        time:   [1.3221 ms 1.3773 ms 1.4399 ms]
Found 13 outliers among 100 measurements (13.00%)
  5 (5.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 5.8s or reduce sample count to 60.
bench_trivial_query/quaint/1000
                        time:   [1.3140 ms 1.3823 ms 1.4633 ms]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 15.1s or reduce sample count to 40.
bench_trivial_query/sqlx_query_as_macro/1000
                        time:   [3.0554 ms 3.1238 ms 3.2000 ms]
Found 12 outliers among 100 measurements (12.00%)
  3 (3.00%) high mild
  9 (9.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 15.5s or reduce sample count to 30.
bench_trivial_query/sqlx_query_from_row/1000
                        time:   [3.2038 ms 3.2750 ms 3.3474 ms]
Found 15 outliers among 100 measurements (15.00%)
  5 (5.00%) high mild
  10 (10.00%) high severe
bench_trivial_query/mysql_by_id/1000
                        time:   [681.22 us 718.25 us 759.70 us]
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/mysql_by_name/1000
                        time:   [667.10 us 702.46 us 742.21 us]
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 13.0s or reduce sample count to 40.
bench_trivial_query/diesel/10000
                        time:   [2.7391 ms 2.8253 ms 2.9190 ms]
Found 14 outliers among 100 measurements (14.00%)
  8 (8.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 12.8s or reduce sample count to 40.
bench_trivial_query/diesel_boxed/10000
                        time:   [2.7419 ms 2.8242 ms 2.9176 ms]
Found 9 outliers among 100 measurements (9.00%)
  5 (5.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 16.5s or reduce sample count to 30.
bench_trivial_query/diesel_queryable_by_name/10000
                        time:   [3.3517 ms 3.4468 ms 3.5511 ms]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 60.2s or reduce sample count to 10.
bench_trivial_query/rustorm/10000
                        time:   [11.206 ms 11.351 ms 11.530 ms]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 56.2s or reduce sample count to 20.
bench_trivial_query/quaint/10000
                        time:   [10.418 ms 10.533 ms 10.666 ms]
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 141.6s or reduce sample count to 10.
bench_trivial_query/sqlx_query_as_macro/10000
                        time:   [27.458 ms 27.669 ms 27.902 ms]
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 148.7s or reduce sample count to 10.
bench_trivial_query/sqlx_query_from_row/10000
                        time:   [29.054 ms 29.284 ms 29.522 ms]
Found 7 outliers among 100 measurements (7.00%)
  6 (6.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 26.6s or reduce sample count to 30.
bench_trivial_query/mysql_by_id/10000
                        time:   [4.9949 ms 5.0879 ms 5.1938 ms]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 26.5s or reduce sample count to 30.
bench_trivial_query/mysql_by_name/10000
                        time:   [5.1862 ms 5.2957 ms 5.4210 ms]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe

bench_medium_complex_query/diesel/1
                        time:   [35.597 us 40.357 us 45.833 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
bench_medium_complex_query/diesel_boxed/1
                        time:   [40.393 us 44.166 us 48.468 us]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
bench_medium_complex_query/diesel_queryable_by_name/1
                        time:   [98.811 us 107.89 us 118.82 us]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
bench_medium_complex_query/quaint/1
                        time:   [88.119 us 99.861 us 112.86 us]
Found 10 outliers among 100 measurements (10.00%)
  10 (10.00%) high mild
bench_medium_complex_query/sqlx_query_as_macro/1
                        time:   [101.43 us 111.03 us 121.53 us]
Found 9 outliers among 100 measurements (9.00%)
  9 (9.00%) high mild
bench_medium_complex_query/sqlx_query_from_row/1
                        time:   [113.51 us 124.42 us 136.27 us]
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild
bench_medium_complex_query/rustorm/1
                        time:   [34.790 us 39.112 us 44.003 us]
bench_medium_complex_query/mysql_by_id/1
                        time:   [39.551 us 44.859 us 50.526 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
bench_medium_complex_query/mysql_by_name/1
                        time:   [34.945 us 39.884 us 45.383 us]
bench_medium_complex_query/diesel/10
                        time:   [56.687 us 63.073 us 69.952 us]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/diesel_boxed/10
                        time:   [60.235 us 66.955 us 74.652 us]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/10
                        time:   [147.91 us 160.66 us 174.91 us]
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/quaint/10
                        time:   [133.74 us 146.87 us 162.01 us]
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/10
                        time:   [194.09 us 213.77 us 236.29 us]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/sqlx_query_from_row/10
                        time:   [204.35 us 224.29 us 247.51 us]
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/rustorm/10
                        time:   [89.497 us 96.956 us 105.24 us]
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/mysql_by_id/10
                        time:   [59.442 us 65.809 us 73.251 us]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe
bench_medium_complex_query/mysql_by_name/10
                        time:   [52.937 us 57.847 us 63.355 us]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/diesel/100
                        time:   [85.054 us 93.557 us 103.78 us]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/diesel_boxed/100
                        time:   [88.683 us 97.349 us 107.50 us]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/100
                        time:   [264.96 us 292.67 us 323.10 us]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
bench_medium_complex_query/quaint/100
                        time:   [365.00 us 390.56 us 419.85 us]
Found 7 outliers among 100 measurements (7.00%)
  6 (6.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/100
                        time:   [664.83 us 708.41 us 757.50 us]
Found 15 outliers among 100 measurements (15.00%)
  7 (7.00%) high mild
  8 (8.00%) high severe
bench_medium_complex_query/sqlx_query_from_row/100
                        time:   [648.69 us 679.59 us 713.71 us]
Found 11 outliers among 100 measurements (11.00%)
  8 (8.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/rustorm/100
                        time:   [410.97 us 437.45 us 467.40 us]
Found 14 outliers among 100 measurements (14.00%)
  6 (6.00%) high mild
  8 (8.00%) high severe
bench_medium_complex_query/mysql_by_id/100
                        time:   [168.97 us 180.50 us 194.25 us]
Found 9 outliers among 100 measurements (9.00%)
  8 (8.00%) high mild
  1 (1.00%) high severe
bench_medium_complex_query/mysql_by_name/100
                        time:   [169.62 us 181.89 us 195.79 us]
Found 14 outliers among 100 measurements (14.00%)
  9 (9.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/diesel/1000
                        time:   [342.83 us 364.57 us 387.94 us]
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/diesel_boxed/1000
                        time:   [321.93 us 338.08 us 355.83 us]
Found 12 outliers among 100 measurements (12.00%)
  6 (6.00%) high mild
  6 (6.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/1000
                        time:   [843.41 us 889.87 us 940.18 us]
Found 11 outliers among 100 measurements (11.00%)
  3 (3.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 9.3s or reduce sample count to 50.
bench_medium_complex_query/quaint/1000
                        time:   [1.9901 ms 2.0582 ms 2.1347 ms]
Found 14 outliers among 100 measurements (14.00%)
  6 (6.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 17.2s or reduce sample count to 30.
bench_medium_complex_query/sqlx_query_as_macro/1000
                        time:   [3.5327 ms 3.5981 ms 3.6729 ms]
Found 13 outliers among 100 measurements (13.00%)
  6 (6.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 18.1s or reduce sample count to 30.
bench_medium_complex_query/sqlx_query_from_row/1000
                        time:   [3.6282 ms 3.7067 ms 3.7945 ms]
Found 14 outliers among 100 measurements (14.00%)
  5 (5.00%) high mild
  9 (9.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 11.7s or reduce sample count to 40.
bench_medium_complex_query/rustorm/1000
                        time:   [2.6406 ms 2.7130 ms 2.7902 ms]
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/mysql_by_id/1000
                        time:   [911.95 us 950.87 us 995.18 us]
Found 13 outliers among 100 measurements (13.00%)
  4 (4.00%) high mild
  9 (9.00%) high severe
bench_medium_complex_query/mysql_by_name/1000
                        time:   [917.90 us 954.93 us 996.85 us]
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 10.5s or reduce sample count to 40.
bench_medium_complex_query/diesel/10000
                        time:   [2.4491 ms 2.5347 ms 2.6340 ms]
Found 14 outliers among 100 measurements (14.00%)
  7 (7.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 11.8s or reduce sample count to 40.
bench_medium_complex_query/diesel_boxed/10000
                        time:   [2.4534 ms 2.5341 ms 2.6275 ms]
Found 14 outliers among 100 measurements (14.00%)
  4 (4.00%) high mild
  10 (10.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 28.2s or reduce sample count to 20.
bench_medium_complex_query/diesel_queryable_by_name/10000
                        time:   [5.8538 ms 5.9802 ms 6.1167 ms]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 87.9s or reduce sample count to 10.
bench_medium_complex_query/quaint/10000
                        time:   [16.677 ms 16.840 ms 17.013 ms]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) high mild
  10 (10.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 160.3s or reduce sample count to 10.
bench_medium_complex_query/sqlx_query_as_macro/10000
                        time:   [30.532 ms 30.859 ms 31.255 ms]
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 162.9s or reduce sample count to 10.
bench_medium_complex_query/sqlx_query_from_row/10000
                        time:   [32.021 ms 32.255 ms 32.496 ms]
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 112.3s or reduce sample count to 10.
bench_medium_complex_query/rustorm/10000
                        time:   [22.373 ms 22.560 ms 22.754 ms]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 35.1s or reduce sample count to 20.
bench_medium_complex_query/mysql_by_id/10000
                        time:   [7.0436 ms 7.1603 ms 7.2934 ms]
Found 12 outliers among 100 measurements (12.00%)
  6 (6.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 36.8s or reduce sample count to 20.
bench_medium_complex_query/mysql_by_name/10000
                        time:   [7.1527 ms 7.2213 ms 7.3188 ms]
Found 13 outliers among 100 measurements (13.00%)
  8 (8.00%) high mild
  5 (5.00%) high severe


Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 25.2s or reduce sample count to 30.
bench_loading_associations_sequentially/diesel/bench_loading_associations_sequentially
                        time:   [4.8543 ms 4.9292 ms 5.0323 ms]
Found 14 outliers among 100 measurements (14.00%)
  5 (5.00%) high mild
  9 (9.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 151.6s or reduce sample count to 10.
bench_loading_associations_sequentially/sqlx
                        time:   [29.534 ms 29.758 ms 30.030 ms]
Found 16 outliers among 100 measurements (16.00%)
  8 (8.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 73.9s or reduce sample count to 10.
bench_loading_associations_sequentially/rustorm
                        time:   [13.906 ms 14.062 ms 14.269 ms]
Found 10 outliers among 100 measurements (10.00%)
  2 (2.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 66.4s or reduce sample count to 10.
bench_loading_associations_sequentially/quaint
                        time:   [12.982 ms 13.089 ms 13.226 ms]
Found 14 outliers among 100 measurements (14.00%)
  8 (8.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 33.9s or reduce sample count to 20.
bench_loading_associations_sequentially/mysql
                        time:   [6.4450 ms 6.5156 ms 6.6017 ms]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe


Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 44.8s or reduce sample count to 20.
bench_insert/diesel/1   time:   [11.532 ms 11.820 ms 12.092 ms]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 59.5s or reduce sample count to 20.
bench_insert/sqlx/1     time:   [13.029 ms 13.283 ms 13.553 ms]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 60.0s or reduce sample count to 20.
bench_insert/quaint/1   time:   [13.247 ms 13.552 ms 13.877 ms]
Found 10 outliers among 100 measurements (10.00%)
  2 (2.00%) low mild
  5 (5.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 72.0s or reduce sample count to 10.
bench_insert/rustorm/1  time:   [13.327 ms 13.670 ms 14.051 ms]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 63.6s or reduce sample count to 10.
bench_insert/mysql/1    time:   [13.538 ms 13.841 ms 14.182 ms]
Found 8 outliers among 100 measurements (8.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 77.5s or reduce sample count to 10.
bench_insert/diesel/10  time:   [14.769 ms 15.197 ms 15.717 ms]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) low mild
  5 (5.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 76.7s or reduce sample count to 10.
bench_insert/sqlx/10    time:   [14.358 ms 14.878 ms 15.409 ms]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 76.7s or reduce sample count to 10.
bench_insert/quaint/10  time:   [14.435 ms 14.754 ms 15.125 ms]
Found 9 outliers among 100 measurements (9.00%)
  1 (1.00%) low mild
  6 (6.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 76.0s or reduce sample count to 10.
bench_insert/rustorm/10 time:   [15.209 ms 15.860 ms 16.652 ms]
Found 9 outliers among 100 measurements (9.00%)
  3 (3.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 77.8s or reduce sample count to 10.
bench_insert/mysql/10   time:   [14.018 ms 14.391 ms 14.786 ms]
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 81.9s or reduce sample count to 10.
bench_insert/diesel/25  time:   [15.511 ms 15.979 ms 16.506 ms]
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 49.1s or reduce sample count to 20.
bench_insert/sqlx/25    time:   [14.919 ms 15.371 ms 15.902 ms]
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) low mild
  3 (3.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 60.5s or reduce sample count to 10.
bench_insert/quaint/25  time:   [15.208 ms 15.484 ms 15.755 ms]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 78.7s or reduce sample count to 10.
bench_insert/rustorm/25 time:   [16.085 ms 16.670 ms 17.415 ms]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 74.0s or reduce sample count to 10.
bench_insert/mysql/25   time:   [15.349 ms 15.672 ms 16.046 ms]
Found 10 outliers among 100 measurements (10.00%)
  2 (2.00%) low mild
  3 (3.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 86.8s or reduce sample count to 10.
bench_insert/diesel/50  time:   [17.748 ms 18.113 ms 18.610 ms]
Found 9 outliers among 100 measurements (9.00%)
  3 (3.00%) low mild
  3 (3.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 83.9s or reduce sample count to 10.
bench_insert/sqlx/50    time:   [16.783 ms 17.049 ms 17.360 ms]
Found 13 outliers among 100 measurements (13.00%)
  2 (2.00%) low severe
  2 (2.00%) low mild
  4 (4.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 82.6s or reduce sample count to 10.
bench_insert/quaint/50  time:   [16.324 ms 16.880 ms 17.492 ms]
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) low mild
  3 (3.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 79.2s or reduce sample count to 10.
bench_insert/rustorm/50 time:   [18.071 ms 18.411 ms 18.780 ms]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) low mild
  5 (5.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 65.6s or reduce sample count to 10.
bench_insert/mysql/50   time:   [16.186 ms 16.786 ms 17.631 ms]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 94.4s or reduce sample count to 10.
bench_insert/diesel/100 time:   [21.975 ms 22.610 ms 23.352 ms]
Found 10 outliers among 100 measurements (10.00%)
  2 (2.00%) low mild
  5 (5.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 95.4s or reduce sample count to 10.
bench_insert/sqlx/100   time:   [20.113 ms 20.613 ms 21.176 ms]
Found 13 outliers among 100 measurements (13.00%)
  4 (4.00%) low mild
  5 (5.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 76.9s or reduce sample count to 10.
bench_insert/quaint/100 time:   [21.168 ms 21.849 ms 22.639 ms]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) low mild
  1 (1.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 99.2s or reduce sample count to 10.
bench_insert/rustorm/100
                        time:   [22.817 ms 23.363 ms 23.979 ms]
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) low severe
  1 (1.00%) low mild
  2 (2.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 109.6s or reduce sample count to 10.
bench_insert/mysql/100  time:   [21.023 ms 21.578 ms 22.230 ms]
Found 12 outliers among 100 measurements (12.00%)
  2 (2.00%) low mild
  7 (7.00%) high mild
  3 (3.00%) high severe

@pimeys
Copy link

pimeys commented Sep 17, 2020

Hey @weiznich! Interesting that you do the benchmarks, I'm happy to see the results. I'm super 100% sure that SQLx/tokio-postgres et.al. will be faster than us just due to our dynamic dispatching in the connectors, and I kind of don't have any time (or need) to start optimizing it yet. My big plan is to take the connectors out from Quaint and let it just act as a query builder for whatever connector the user needs. But there's no time for me to do that now.

The thing with SQLite is how it's not really an async database, so what we've been doing is just blocking in an async context. When adding a runtime on top of that, naturally it gets slower. You might want to try to enable WAL in SQLite and see if it makes it work faster, but I'm not holding my breath.

One trick I can do for now is to use tokio's block_in_place to signal the runtime to not block other requests if running blocking code. If you have time, do a benchmark with this branch and tell me how it performs!

prisma/quaint#185

P.s. try latest masters in SQLx and see if they perform better. They've been optimizing SQLite performance in the past months.

@weiznich
Copy link
Member Author

I finally got the time to fix and run the mysql benchmarks. (Rustorm was broken/really slow due to not implementing batch inserts on mysql correctly.) This means there is now a full sets of results in the second posts.

@diesel-rs/reviewers If anyone of you want's to learn some performance investigations here are some points that could be worth looking at:

  • Insert statements for large sets seems to be relatively slow for diesel in general. It seems to be a meaningful optimization target. Without any investigation I would suspect this to be caused by one of the following points:
    • We are inefficient at binding a large number of values
    • Adding a large number of bind parameters (== small strings) to our query string causes the slow down, maybe due to repeating reallocation of the query string.
  • QueryableByName seems to perform around factor 2 slower than Queryable. This is not something that can be observed for rusqlite, postgres and mysql for get_by_id and get_by_name. Let's have a look what is causing this.

I would probably just run the corresponding benchmark using perf/cargo flamegraph and see if that yields something ssuspicioususpicious. After that we hopefully have an idea what is causing those and can investigate the affected code in more detail.

@weiznich
Copy link
Member Author

@pimeys

I'm super 100% sure that SQLx/tokio-postgres et.al. will be faster than us just due to our dynamic dispatching in the connectors, and I kind of don't have any time (or need) to start optimizing it yet. My big plan is to take the connectors out from Quaint and let it just act as a query builder for whatever connector the user needs. But there's no time for me to do that now.

First of all I didn't do those benchmarks to point at anyone to say: Your software is slow, you need to improve it. It did those benchmarks mostly for getting:

a) Some set of tests that allow us as diesel team to measure if a certain change has a large impact on performance or not (I've done a few of such potential performance critical changes in the last time and I wished there was something to check against)
b) I've included the pure rust database crates (postgres/mysql/rusqlite) to see how large the overhead of diesel's query builder is compared to executing optimized raw sql.
c) I've included sqlx, quaint and rustorm as comparison as they all implement a multi-backend abstracting interface for accessing relational database.
d) Additionally we may want to replace some dependencies on platform provided c-libs (like libpq and libmysqlclient) someday. For this it is important to know how the pure rust implementations (postgres, mysql and sqlx) compare in terms of performance compared to the existing diesel implementation. As long as they are slower that's not really an option in my opinion.

That said: I was quite surprised to see that for larger result sets quaint/postgres seems perform better than sqlx/postgres. For large result sets I would assume that deserializing the result into the provided structure is taking most of the time, as opposed to query building. Seems like sqlx does have some performance road block there.

The thing with SQLite is how it's not really an async database, so what we've been doing is just blocking in an async context. When adding a runtime on top of that, naturally it gets slower. You might want to try to enable WAL in SQLite and see if it makes it work faster, but I'm not holding my breath.

One of my main conclusions from the preliminary results is that there will not be a ashttps://github.com/launchbadge/sqlx/compare/v0.4.0-beta.1...masterync SqliteConnection for diesel, as this does not provide any meaningful gain.

P.s. try latest masters in SQLx and see if they perform better. They've been optimizing SQLite performance in the past months.

I've used v0.4.0-beta.1. Looking at the commits at their master branch since the release of that version, does not show anything performance related.

One trick I can do for now is to use tokio's block_in_place to signal the runtime to not block other requests if running blocking code. If you have time, do a benchmark with this branch and tell me how it performs!

prisma/quaint#185

I will try to run the sqlite benchmarks with that change again as soon as I find some time.

@weiznich weiznich force-pushed the more/benches branch 4 times, most recently from 851e6e1 to 9b73124 Compare September 25, 2020 10:48
@weiznich
Copy link
Member Author

:diesel run benches

@weiznich weiznich mentioned this pull request Sep 28, 2020
@pickfire
Copy link
Contributor

cc @fafhrd91 who may be interested in this

@blackbeam
Copy link

@weiznich, thanks. This results are quite informative.

I, to be honest, was quite surprised (in a negative way) by the mysql score in this benchmark. Later, however, my flamegraph results revealed an obvious, but significant inefficiency in the Conn::read_packet (up to 30% speedup), that was fixed in mysql v20.0.1.

Another observation regarding your benchmark code, is unnecessary copying, implied by row.get(..).unwrap(), that makes the results less representative. I suggest to replace it with row.take(..).unwrap() (should add another 5% to some benches).

@weiznich
Copy link
Member Author

weiznich commented Oct 6, 2020

@blackbeam Thanks for this hint. I've updated the benchmark accordingly. Your changes show definitively improvements for small size result sets, but the slowdown for large queries remains. I would guess that this is somehow related to how data are deserialized.

New Mysql Results
    Updating crates.io index
    Finished bench [optimized] target(s) in 2.63s
     Running target/release/deps/benchmarks-0a902ee888a475bb
bench_trivial_query/diesel/1
                        time:   [37.152 us 41.401 us 46.146 us]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
bench_trivial_query/diesel_boxed/1
                        time:   [43.208 us 48.944 us 55.328 us]
bench_trivial_query/diesel_queryable_by_name/1
                        time:   [84.081 us 90.876 us 98.198 us]
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe
bench_trivial_query/rustorm/1
                        time:   [45.159 us 49.766 us 54.818 us]
bench_trivial_query/quaint/1
                        time:   [110.98 us 121.04 us 131.71 us]
bench_trivial_query/sqlx_query_as_macro/1
                        time:   [91.489 us 98.140 us 105.85 us]
Found 12 outliers among 100 measurements (12.00%)
  10 (10.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/sqlx_query_from_row/1
                        time:   [81.093 us 88.219 us 96.404 us]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
bench_trivial_query/mysql_by_id/1
                        time:   [35.319 us 39.026 us 43.015 us]
bench_trivial_query/mysql_by_name/1
                        time:   [35.197 us 38.654 us 42.275 us]
bench_trivial_query/diesel/10
                        time:   [56.571 us 62.366 us 68.825 us]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/diesel_boxed/10
                        time:   [49.565 us 55.515 us 62.982 us]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/diesel_queryable_by_name/10
                        time:   [125.21 us 136.39 us 149.44 us]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/rustorm/10
                        time:   [65.518 us 70.946 us 77.082 us]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
bench_trivial_query/quaint/10
                        time:   [136.03 us 151.40 us 168.50 us]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/sqlx_query_as_macro/10
                        time:   [180.53 us 195.17 us 212.23 us]
Found 7 outliers among 100 measurements (7.00%)
  6 (6.00%) high mild
  1 (1.00%) high severe
bench_trivial_query/sqlx_query_from_row/10
                        time:   [193.35 us 208.89 us 226.97 us]
Found 7 outliers among 100 measurements (7.00%)
  3 (3.00%) high mild
  4 (4.00%) high severe
bench_trivial_query/mysql_by_id/10
                        time:   [52.309 us 57.457 us 63.477 us]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/mysql_by_name/10
                        time:   [46.232 us 50.193 us 54.791 us]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/diesel/100
                        time:   [80.907 us 85.547 us 90.875 us]
Found 15 outliers among 100 measurements (15.00%)
  10 (10.00%) high mild
  5 (5.00%) high severe
bench_trivial_query/diesel_boxed/100
                        time:   [84.724 us 88.850 us 93.681 us]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe
bench_trivial_query/diesel_queryable_by_name/100
                        time:   [166.54 us 181.46 us 202.21 us]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/rustorm/100
                        time:   [225.93 us 236.56 us 249.74 us]
Found 12 outliers among 100 measurements (12.00%)
  10 (10.00%) high mild
  2 (2.00%) high severe
bench_trivial_query/quaint/100
                        time:   [253.15 us 267.07 us 283.82 us]
Found 10 outliers among 100 measurements (10.00%)
  7 (7.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/sqlx_query_as_macro/100
                        time:   [577.36 us 604.49 us 637.21 us]
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/sqlx_query_from_row/100
                        time:   [575.53 us 599.48 us 628.09 us]
Found 14 outliers among 100 measurements (14.00%)
  8 (8.00%) high mild
  6 (6.00%) high severe
bench_trivial_query/mysql_by_id/100
                        time:   [104.79 us 109.73 us 115.71 us]
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/mysql_by_name/100
                        time:   [110.70 us 117.16 us 124.80 us]
Found 16 outliers among 100 measurements (16.00%)
  7 (7.00%) high mild
  9 (9.00%) high severe
bench_trivial_query/diesel/1000
                        time:   [345.52 us 361.24 us 380.01 us]
Found 14 outliers among 100 measurements (14.00%)
  5 (5.00%) high mild
  9 (9.00%) high severe
bench_trivial_query/diesel_boxed/1000
                        time:   [336.86 us 350.42 us 365.85 us]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe
bench_trivial_query/diesel_queryable_by_name/1000
                        time:   [456.62 us 476.16 us 498.85 us]
Found 7 outliers among 100 measurements (7.00%)
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 6.3s or reduce sample count to 60.
bench_trivial_query/rustorm/1000
                        time:   [1.3220 ms 1.3759 ms 1.4393 ms]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 6.0s or reduce sample count to 60.
bench_trivial_query/quaint/1000
                        time:   [1.3268 ms 1.3655 ms 1.4074 ms]
Found 9 outliers among 100 measurements (9.00%)
  8 (8.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 15.4s or reduce sample count to 30.
bench_trivial_query/sqlx_query_as_macro/1000
                        time:   [3.0667 ms 3.1106 ms 3.1590 ms]
Found 13 outliers among 100 measurements (13.00%)
  6 (6.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 16.2s or reduce sample count to 30.
bench_trivial_query/sqlx_query_from_row/1000
                        time:   [3.1689 ms 3.2128 ms 3.2602 ms]
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) high mild
  7 (7.00%) high severe
bench_trivial_query/mysql_by_id/1000
                        time:   [554.75 us 577.70 us 604.08 us]
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe
bench_trivial_query/mysql_by_name/1000
                        time:   [609.88 us 634.10 us 660.65 us]
Found 10 outliers among 100 measurements (10.00%)
  6 (6.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 13.5s or reduce sample count to 40.
bench_trivial_query/diesel/10000
                        time:   [2.5959 ms 2.6402 ms 2.6932 ms]
Found 12 outliers among 100 measurements (12.00%)
  6 (6.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 13.6s or reduce sample count to 40.
bench_trivial_query/diesel_boxed/10000
                        time:   [2.6416 ms 2.6957 ms 2.7591 ms]
Found 11 outliers among 100 measurements (11.00%)
  3 (3.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 19.2s or reduce sample count to 30.
bench_trivial_query/diesel_queryable_by_name/10000
                        time:   [3.3473 ms 3.4172 ms 3.5087 ms]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 62.1s or reduce sample count to 10.
bench_trivial_query/rustorm/10000
                        time:   [12.377 ms 12.674 ms 12.984 ms]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 59.1s or reduce sample count to 20.
bench_trivial_query/quaint/10000
                        time:   [11.573 ms 11.748 ms 11.939 ms]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 158.5s or reduce sample count to 10.
bench_trivial_query/sqlx_query_as_macro/10000
                        time:   [31.895 ms 32.364 ms 32.851 ms]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 174.0s or reduce sample count to 10.
bench_trivial_query/sqlx_query_from_row/10000
                        time:   [34.714 ms 35.279 ms 35.864 ms]

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 26.6s or reduce sample count to 30.
bench_trivial_query/mysql_by_id/10000
                        time:   [4.9393 ms 5.0256 ms 5.1244 ms]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 27.3s or reduce sample count to 20.
bench_trivial_query/mysql_by_name/10000
                        time:   [5.0857 ms 5.1931 ms 5.3126 ms]
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) high mild
  5 (5.00%) high severe

bench_medium_complex_query/diesel/1
                        time:   [43.274 us 48.237 us 53.868 us]
bench_medium_complex_query/diesel_boxed/1
                        time:   [38.555 us 41.738 us 45.619 us]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
bench_medium_complex_query/diesel_queryable_by_name/1
                        time:   [96.718 us 102.49 us 109.08 us]
Found 12 outliers among 100 measurements (12.00%)
  8 (8.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/quaint/1
                        time:   [87.440 us 94.484 us 102.96 us]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
bench_medium_complex_query/sqlx_query_as_macro/1
                        time:   [95.683 us 101.94 us 109.60 us]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
bench_medium_complex_query/sqlx_query_from_row/1
                        time:   [87.405 us 93.503 us 101.12 us]
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild
bench_medium_complex_query/rustorm/1
                        time:   [38.432 us 41.710 us 45.516 us]
bench_medium_complex_query/mysql_by_id/1
                        time:   [34.626 us 38.085 us 42.139 us]
bench_medium_complex_query/mysql_by_name/1
                        time:   [31.801 us 34.817 us 38.180 us]
bench_medium_complex_query/diesel/10
                        time:   [60.332 us 66.017 us 72.644 us]
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe
bench_medium_complex_query/diesel_boxed/10
                        time:   [55.634 us 59.208 us 63.545 us]
Found 9 outliers among 100 measurements (9.00%)
  3 (3.00%) high mild
  6 (6.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/10
                        time:   [165.27 us 176.19 us 189.17 us]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe
bench_medium_complex_query/quaint/10
                        time:   [130.07 us 139.34 us 150.55 us]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/10
                        time:   [183.70 us 193.95 us 206.32 us]
Found 12 outliers among 100 measurements (12.00%)
  6 (6.00%) high mild
  6 (6.00%) high severe
bench_medium_complex_query/sqlx_query_from_row/10
                        time:   [191.74 us 201.90 us 214.20 us]
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe
bench_medium_complex_query/rustorm/10
                        time:   [87.091 us 92.363 us 98.731 us]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/mysql_by_id/10
                        time:   [49.106 us 52.323 us 56.135 us]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/mysql_by_name/10
                        time:   [51.928 us 55.904 us 60.377 us]
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/diesel/100
                        time:   [80.983 us 86.498 us 93.106 us]
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/diesel_boxed/100
                        time:   [84.422 us 89.587 us 95.863 us]
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/100
                        time:   [250.77 us 268.78 us 289.57 us]
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe
bench_medium_complex_query/quaint/100
                        time:   [401.18 us 419.79 us 442.21 us]
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/sqlx_query_as_macro/100
                        time:   [611.52 us 637.48 us 669.58 us]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/sqlx_query_from_row/100
                        time:   [622.78 us 646.98 us 675.65 us]
Found 14 outliers among 100 measurements (14.00%)
  7 (7.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/rustorm/100
                        time:   [405.89 us 422.57 us 442.37 us]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe
bench_medium_complex_query/mysql_by_id/100
                        time:   [142.39 us 149.40 us 157.80 us]
Found 10 outliers among 100 measurements (10.00%)
  6 (6.00%) high mild
  4 (4.00%) high severe
bench_medium_complex_query/mysql_by_name/100
                        time:   [149.52 us 156.94 us 165.24 us]
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/diesel/1000
                        time:   [332.23 us 346.95 us 363.40 us]
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) high mild
  7 (7.00%) high severe
bench_medium_complex_query/diesel_boxed/1000
                        time:   [352.30 us 369.71 us 390.21 us]
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe
bench_medium_complex_query/diesel_queryable_by_name/1000
                        time:   [813.80 us 844.81 us 880.82 us]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 9.2s or reduce sample count to 50.
bench_medium_complex_query/quaint/1000
                        time:   [1.9647 ms 2.0093 ms 2.0628 ms]
Found 14 outliers among 100 measurements (14.00%)
  7 (7.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 18.0s or reduce sample count to 30.
bench_medium_complex_query/sqlx_query_as_macro/1000
                        time:   [3.5582 ms 3.6170 ms 3.6855 ms]
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 18.9s or reduce sample count to 30.
bench_medium_complex_query/sqlx_query_from_row/1000
                        time:   [3.7435 ms 3.7938 ms 3.8508 ms]
Found 15 outliers among 100 measurements (15.00%)
  7 (7.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 13.1s or reduce sample count to 40.
bench_medium_complex_query/rustorm/1000
                        time:   [2.7426 ms 2.7854 ms 2.8330 ms]
Found 14 outliers among 100 measurements (14.00%)
  3 (3.00%) high mild
  11 (11.00%) high severe
bench_medium_complex_query/mysql_by_id/1000
                        time:   [826.50 us 850.70 us 878.65 us]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe
bench_medium_complex_query/mysql_by_name/1000
                        time:   [847.88 us 872.23 us 899.69 us]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 11.4s or reduce sample count to 40.
bench_medium_complex_query/diesel/10000
                        time:   [2.3859 ms 2.4327 ms 2.4878 ms]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 11.3s or reduce sample count to 40.
bench_medium_complex_query/diesel_boxed/10000
                        time:   [2.3760 ms 2.4398 ms 2.5223 ms]
Found 11 outliers among 100 measurements (11.00%)
  3 (3.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 30.3s or reduce sample count to 20.
bench_medium_complex_query/diesel_queryable_by_name/10000
                        time:   [6.0122 ms 6.1341 ms 6.2842 ms]
Found 9 outliers among 100 measurements (9.00%)
  3 (3.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 91.7s or reduce sample count to 10.
bench_medium_complex_query/quaint/10000
                        time:   [18.675 ms 18.912 ms 19.151 ms]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 183.2s or reduce sample count to 10.
bench_medium_complex_query/sqlx_query_as_macro/10000
                        time:   [37.745 ms 38.285 ms 38.815 ms]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 212.8s or reduce sample count to 10.
bench_medium_complex_query/sqlx_query_from_row/10000
                        time:   [40.464 ms 41.035 ms 41.626 ms]
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 157.3s or reduce sample count to 10.
bench_medium_complex_query/rustorm/10000
                        time:   [28.841 ms 29.401 ms 29.976 ms]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 38.8s or reduce sample count to 20.
bench_medium_complex_query/mysql_by_id/10000
                        time:   [7.1553 ms 7.2763 ms 7.4160 ms]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 40.3s or reduce sample count to 20.
bench_medium_complex_query/mysql_by_name/10000
                        time:   [7.6327 ms 7.7929 ms 7.9645 ms]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe


Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 29.9s or reduce sample count to 20.
bench_loading_associations_sequentially/diesel/bench_loading_associations_sequentially
                        time:   [5.5528 ms 5.6760 ms 5.8487 ms]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 173.5s or reduce sample count to 10.
bench_loading_associations_sequentially/sqlx
                        time:   [36.147 ms 36.585 ms 37.036 ms]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 88.9s or reduce sample count to 10.
bench_loading_associations_sequentially/rustorm
                        time:   [17.298 ms 17.619 ms 17.959 ms]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 80.9s or reduce sample count to 10.
bench_loading_associations_sequentially/quaint
                        time:   [15.943 ms 16.124 ms 16.317 ms]
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 37.6s or reduce sample count to 20.
bench_loading_associations_sequentially/mysql
                        time:   [7.1382 ms 7.2550 ms 7.3999 ms]
Found 10 outliers among 100 measurements (10.00%)
  6 (6.00%) high mild
  4 (4.00%) high severe


Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 39.4s or reduce sample count to 20.
bench_insert/diesel/1   time:   [9.6073 ms 10.152 ms 10.614 ms]

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 54.0s or reduce sample count to 20.
bench_insert/sqlx/1     time:   [12.950 ms 13.246 ms 13.566 ms]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 60.4s or reduce sample count to 10.
bench_insert/quaint/1   time:   [12.711 ms 12.974 ms 13.242 ms]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 64.6s or reduce sample count to 10.
bench_insert/rustorm/1  time:   [13.870 ms 14.284 ms 14.813 ms]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) low mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 63.3s or reduce sample count to 10.
bench_insert/mysql/1    time:   [13.620 ms 13.929 ms 14.290 ms]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 71.4s or reduce sample count to 10.
bench_insert/diesel/10  time:   [15.319 ms 15.917 ms 16.670 ms]
Found 12 outliers among 100 measurements (12.00%)
  2 (2.00%) low mild
  2 (2.00%) high mild
  8 (8.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 80.4s or reduce sample count to 10.
bench_insert/sqlx/10    time:   [14.354 ms 14.880 ms 15.483 ms]
Found 13 outliers among 100 measurements (13.00%)
  3 (3.00%) low mild
  3 (3.00%) high mild
  7 (7.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 65.6s or reduce sample count to 10.
bench_insert/quaint/10  time:   [14.630 ms 15.160 ms 15.785 ms]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 75.1s or reduce sample count to 10.
bench_insert/rustorm/10 time:   [14.316 ms 14.862 ms 15.547 ms]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 73.7s or reduce sample count to 10.
bench_insert/mysql/10   time:   [14.231 ms 14.769 ms 15.395 ms]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) low mild
  5 (5.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 78.6s or reduce sample count to 10.
bench_insert/diesel/25  time:   [15.796 ms 16.333 ms 17.024 ms]
Found 10 outliers among 100 measurements (10.00%)
  2 (2.00%) low mild
  3 (3.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 86.2s or reduce sample count to 10.
bench_insert/sqlx/25    time:   [15.640 ms 16.102 ms 16.692 ms]
Found 9 outliers among 100 measurements (9.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 83.2s or reduce sample count to 10.
bench_insert/quaint/25  time:   [15.252 ms 15.720 ms 16.287 ms]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 83.3s or reduce sample count to 10.
bench_insert/rustorm/25 time:   [15.632 ms 15.984 ms 16.379 ms]
Found 13 outliers among 100 measurements (13.00%)
  5 (5.00%) low mild
  3 (3.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 60.5s or reduce sample count to 10.
bench_insert/mysql/25   time:   [14.826 ms 15.156 ms 15.541 ms]
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  6 (6.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 86.4s or reduce sample count to 10.
bench_insert/diesel/50  time:   [17.589 ms 17.951 ms 18.376 ms]
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) low severe
  2 (2.00%) low mild
  4 (4.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 70.3s or reduce sample count to 10.
bench_insert/sqlx/50    time:   [17.000 ms 17.303 ms 17.652 ms]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 91.3s or reduce sample count to 10.
bench_insert/quaint/50  time:   [17.200 ms 17.701 ms 18.257 ms]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 94.3s or reduce sample count to 10.
bench_insert/rustorm/50 time:   [17.819 ms 18.296 ms 18.820 ms]
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) low mild
  3 (3.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 80.7s or reduce sample count to 10.
bench_insert/mysql/50   time:   [16.605 ms 16.836 ms 17.082 ms]
Found 8 outliers among 100 measurements (8.00%)
  1 (1.00%) low mild
  4 (4.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 105.9s or reduce sample count to 10.
bench_insert/diesel/100 time:   [22.263 ms 22.686 ms 23.194 ms]
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 91.5s or reduce sample count to 10.
bench_insert/sqlx/100   time:   [20.916 ms 21.418 ms 21.965 ms]
Found 12 outliers among 100 measurements (12.00%)
  7 (7.00%) low mild
  2 (2.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 154.5s or reduce sample count to 10.
bench_insert/quaint/100 time:   [20.999 ms 21.603 ms 22.349 ms]
Found 8 outliers among 100 measurements (8.00%)
  1 (1.00%) low mild
  4 (4.00%) high mild
  3 (3.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 99.4s or reduce sample count to 10.
bench_insert/rustorm/100
                        time:   [23.744 ms 24.398 ms 25.187 ms]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) low mild
  1 (1.00%) high mild
  4 (4.00%) high severe

Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 102.6s or reduce sample count to 10.
bench_insert/mysql/100  time:   [20.378 ms 20.781 ms 21.200 ms]
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  1 (1.00%) high severe

@weiznich weiznich added the run-benchmarks Used to indicate that github actions should run our benchmark suite label Oct 9, 2020
@weiznich weiznich force-pushed the more/benches branch 2 times, most recently from c9ad679 to f0448d6 Compare October 9, 2020 09:25
@weiznich weiznich changed the title [WIP] Rework benchmarks Rework benchmarks Oct 9, 2020
This commit reworks our benchmark suite:

* Use criterion instead of std-lib bencher
* Benchmark more different sizes
* Add benchmarks for other rust db-crates as comparision
* Add a new insert benchmark
@weiznich weiznich merged commit b595683 into diesel-rs:master Nov 3, 2020
@pickfire
Copy link
Contributor

pickfire commented Nov 3, 2020

@weiznich Do you want to push the results to README and put the date and versions?

@weiznich
Copy link
Member Author

weiznich commented Nov 3, 2020

@pickfire This is not planed as those benchmarks are written to be a tool for internal comparison not for promoting diesel. The problem there is writing representative benchmarks is really hard and I don't know the other libs that well that it would be really fair. That said those benchmarks can become something like that at a later point in time, but that would require some more tuning (in the best case from the original crate authors). Any contributions here are welcome.

Otherwise I thinking about writing a bigger blog post about comparing the different options to connect to relational databases using rust. Such a post would then also contain a commented version of this benchmark results.

@pickfire
Copy link
Contributor

pickfire commented Nov 3, 2020

But one thing I think that would be interesting is to compare against drogon https://github.com/an-tao/drogon (c++) as baseline since their database layer seemed fast enough such that it is able to take them to the first place for last techempower benchmark especially on multiple queries. It maybe harder to compare since it is not rust but their getFastDbClient looks interesting.

@weiznich
Copy link
Member Author

weiznich commented Nov 3, 2020

@pickfire That's not something that's on my personal todo list, because as written above: The current set of benchmarks gives a quite good overview of the state of database connection crates in rust. For me that's a big enough datapoint for now. For me there are more then enough open issues and feature points to work on, as I would have time and motivation to dig into some obscure c++ database for the sake of having the fastest benchmark. I would rather like to build a reliable library to work with different kind of relational databases.
That all does not mean I will stop anyone from submitting another benchmark based on that, but that needs to be easy buildable and maintainable and should not place any additional burden on the diesel maintainers. So if you are interested in that, sure feel free to submit a PR and start working on tuning the performance afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion desired help wanted run-benchmarks Used to indicate that github actions should run our benchmark suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants