Skip to content

Commit 60a35d2

Browse files
committed
docs: update benchmark results
1 parent 3dc8964 commit 60a35d2

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- **TypeScript** by default.
1717
- Support for `Uint8Array` and `BigInt`.
1818
- Support for both **CJS** and **ESM** exports.
19-
- Up to [**~40% faster**](#performance) compared to **sqlstring**.
19+
- Up to [**~50% faster**](#performance) compared to **sqlstring**.
2020
- Distinguishes when a keyword is used as value.
2121
- Distinguishes when a column has a keyword name.
2222
- Distinguishes between multiple clauses/keywords in the same query.
@@ -55,14 +55,12 @@ deno add npm:sql-escaper
5555

5656
### [MySQL2](https://github.com/sidorares/node-mysql2)
5757

58-
🚧 For **MySQL2**, it already uses **SQL Escaper** as its default escaping library since version `3.17.0`, so you just need to update it to the latest version:
58+
For **MySQL2**, it already uses **SQL Escaper** as its default escaping library since version `3.17.0`, so you just need to update it to the latest version:
5959

6060
```bash
61-
npm i mysql2@latest # soon
61+
npm i mysql2@latest
6262
```
6363

64-
- Check the progress migration in [sidorares/node-mysql2#4054](https://github.com/sidorares/node-mysql2/pull/4054).
65-
6664
### [mysqljs/mysql](https://github.com/mysqljs/mysql)
6765

6866
You can use an overrides in your _package.json_:
@@ -83,6 +81,8 @@ You can use an overrides in your _package.json_:
8381

8482
## Usage
8583

84+
For _up-to-date_ documentation, always follow the [**README.md**](https://github.com/mysqljs/sql-escaper?tab=readme-ov-file#readme) in the **GitHub** repository.
85+
8686
### Quickstart
8787

8888
```js
@@ -104,8 +104,6 @@ escape(raw('NOW()'));
104104
// => 'NOW()'
105105
```
106106

107-
> For _up-to-date_ documentation, always follow the [**README.md**](https://github.com/mysqljs/sql-escaper?tab=readme-ov-file#readme) in the **GitHub** repository.
108-
109107
### Import
110108

111109
#### ES Modules
@@ -355,12 +353,12 @@ Each benchmark formats `10,000` queries using `format` with `100` mixed values (
355353

356354
| Benchmark | sqlstring | SQL Escaper | Difference |
357355
| ---------------------------------------- | --------: | ----------: | ---------------: |
358-
| Select 100 values | 248.8 ms | 178.7 ms | **1.39x faster** |
359-
| Insert 100 values | 247.5 ms | 196.2 ms | **1.26x faster** |
360-
| SET with 100 values | 257.5 ms | 205.2 ms | **1.26x faster** |
361-
| SET with 100 objects | 348.3 ms | 250.5 ms | **1.39x faster** |
362-
| ON DUPLICATE KEY UPDATE with 100 values | 466.2 ms | 394.6 ms | **1.18x faster** |
363-
| ON DUPLICATE KEY UPDATE with 100 objects | 558.2 ms | 433.9 ms | **1.29x faster** |
356+
| Select 100 values | 264.6 ms | 170.3 ms | **1.55x faster** |
357+
| Insert 100 values | 266.0 ms | 189.2 ms | **1.41x faster** |
358+
| SET with 100 values | 273.9 ms | 196.1 ms | **1.40x faster** |
359+
| SET with 100 objects | 360.7 ms | 249.3 ms | **1.45x faster** |
360+
| ON DUPLICATE KEY UPDATE with 100 values | 515.7 ms | 375.9 ms | **1.37x faster** |
361+
| ON DUPLICATE KEY UPDATE with 100 objects | 598.4 ms | 441.5 ms | **1.36x faster** |
364362

365363
- See detailed results and how the benchmarks are run in the [**benchmark**](https://github.com/mysqljs/sql-escaper/tree/main/benchmark) directory.
366364

0 commit comments

Comments
 (0)