BENCH: add benchmarks for SQL
State: closed

xref #6701, #6416

WIP for now: intitial benchmarks for sql functions
- Where should the benches be placed? Because there is `io_bench.py`,  `packers.py` and `parsers_vb.py` which all contain io related benchmarks. Or should I create a new file?
- The first tests are a generic mixed-type frame writing/reading, both with sqlalchemy (sqlite) and sqlite fallback
  - I am going to add seperate benches for different types (float, string, datetime)
  - other important things to test?

First run with `./test_perf.sh -b master -t HEAD -r sql` gives:

```
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------
sql_write_fallback                           | 218.5094 | 219.5977 |   0.9950 |
sql_write_sqlalchemy                         | 347.1383 | 347.9416 |   0.9977 |
sql_read_query_fallback                      |  28.5973 |  28.6067 |   0.9997 |
sql_read_table_sqlalchemy                    |  39.0046 |  38.9366 |   1.0017 |
sql_read_query_fallback                      |  35.9294 |  35.4296 |   1.0141 |
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------

Ratio < 1.0 means the target commit is faster then the baseline.
Seed used: 1234

Target [3bcc9c2] : BENCH: add benchmarks for SQL
Base   [86ecb99] : BUG: fix iat and at for Float64Index
```

You can see that the sqlalchemy version is somewhat slower than the fallback version.


Labels:
name: IO SQL
description: to_sql, read_sql, read_sql_query

Comments:
good where u have it
you can add a simple one to packers as well

idea is that it shows comparison of all different io methods 

Added some more benchs (maybe a little bit too many), and one to `packers`

```
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------
sql_float_nan_write_sqlalchemy               | 125.3287 | 137.3063 |   0.9128 |
sql_string_write_sqlalchemy                  | 148.2577 | 156.2933 |   0.9486 |
sql_float_write_sqlalchemy                   | 129.8637 | 136.6666 |   0.9502 |
sql_write_sqlalchemy                         | 358.2884 | 370.3803 |   0.9674 |
sql_datetime_write_sqlalchemy                | 307.3073 | 317.2623 |   0.9686 |
packers_write_sql                            | 4910.1730 | 5027.5867 |   0.9766 |
sql_read_query_fallback                      |  36.3814 |  37.0037 |   0.9832 |
sql_datetime_nan_write_sqlalchemy            | 308.7813 | 309.4633 |   0.9978 |
sql_string_write_fallback                    | 106.1896 | 104.9533 |   1.0118 |
sql_float_read_table_sqlalchemy              |  15.1283 |  14.8710 |   1.0173 |
sql_datetime_read_and_parse_sqlalchemy       |  24.8260 |  24.3480 |   1.0196 |
sql_read_query_fallback                      |  29.0987 |  28.5173 |   1.0204 |
sql_float_nan_write_fallback                 |  84.9530 |  82.1304 |   1.0344 |
sql_float_read_query_sqlalchemy              |  13.7107 |  13.0347 |   1.0519 |
sql_float_read_query_fallback                |   7.2873 |   6.8930 |   1.0572 |
sql_datetime_read_as_native_sqlalchemy       |  30.6773 |  28.9330 |   1.0603 |
sql_read_table_sqlalchemy                    |  41.4987 |  38.4807 |   1.0784 |
sql_write_fallback                           | 234.2334 | 216.6977 |   1.0809 |
packers_read_sql                             | 558.3711 | 510.8507 |   1.0930 |
sql_float_write_fallback                     |  90.3120 |  81.4170 |   1.1093 |
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------

Ratio < 1.0 means the target commit is faster then the baseline.
Seed used: 1234

Target [1076596] : BENCH: add benchmarks for SQL
Base   [d839555] : RLS: v0.14.1 final
```

Removed the nan-specific ones, does not seem that useful.