Name |
Time1 |
Percent2 |
RowReader3 |
ScanRow4 |
Native5 |
SQLX6 |
Combined7 |
Multi8 |
Individual9 |
Note |
Reads into testStruct1 (37 fields total) |
Faster | 1.129 | - |
| | | | | | |
|
Multi Faster | 1.215 | 108% |
| | | | | | |
|
Individual Faster | 1.593 | 141% |
| | | | | | |
|
Native | 2.397 | 212% |
| | | | | | |
|
Native Prepared | 2.852 | 253% |
| | | | | | |
Uses prepared statement instead of a query |
SQLX | 4.973 | 440% |
| | | | | | |
|
ScanRow (no RowReader) into testStruct110 |
SRMul Faster | 1.882 | - |
| | | | | | |
|
SRMul Multi Faster | 3.578 | 190% |
| | | | | | |
|
SRMul Individual Faster | 7.694 | 409% |
| | | | | | |
|
SRMul Native | 2.205 | 117% |
| | | | | | |
Unlike the first “Native” test, pointers to variables are precalculated in an array. |
Reading into a struct with 1 member |
SROne Faster | .05324 | - |
| | | | | | |
|
SROne ScanRow | .21000 | 394% |
| | | | | | |
|
SROne Native | .05979 | 112% |
| | | | | | |
|
1) Time in seconds to run 1 million iterations of just the scanning. SQL Query/Next functions occur before benchmark timing starts.
2) Percent time slower than the base test.
3) Uses RowReader.ScanRows() for reading
4) Uses gofastersql.ScanRow() functions (no RowReader)
5) Uses native sql.Rows.Scan
7) Passes in just the testStruct1 variable
8) Passes in the top level members of the testStruct1 variable (5 variables)
9) Passes in all members of testStruct1 individually (37 fields total)
10) Reading without a RowReader is expected to take much longer, but using it with a single struct is still usually faster than the alternatives.