rregex 1.13.0 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,43 +58,69 @@ This package includes builds for multiple runtimes
58
58
 
59
59
  ## Benchmarks
60
60
 
61
- In general terms `rregex` is at least 1 order of magnitud slower than the native `RegExp` object, but still have a good performance. **Unless you required some of the features that `rregex` provides, you should always consider using the native `RegExp` object**
62
-
63
- > Benchmarks are executed using [test/deno.bench.mjs](./test/deno.bench.mjs), and [test/node.bench.mjs](./test/node.bench.mjs)
64
-
65
- ### Email
66
-
67
- | benchmark | time (avg) | iter/s |
68
- | --------- | -------------: | ------: |
69
- | RegExp | 342.91 µs/iter | 2,916.2 |
70
- | RRegex | 7.27 ms/iter | 137.6 |
71
-
72
- > summary: `RegExp` is 21.19x faster than `RRegex`
73
-
74
- ### IP
75
-
76
- | benchmark | time (avg) | iter/s |
77
- | --------- | ------------: | -------: |
78
- | RegExp | 72.63 µs/iter | 13,767.7 |
79
- | RRegex | 7.02 ms/iter | 142.5 |
80
-
81
- > summary: `RegExp` is 96.59x faster than `RRegex`
82
-
83
- ### URI
84
-
85
- | benchmark | time (avg) | iter/s |
86
- | --------- | -------------: | ----------: |
87
- | RegExp | 688.79 ns/iter | 1,451,825.0 |
88
- | RRegex | 22.52 ms/iter | 44.4 |
89
-
90
- > summary: `RegExp` is 32689.42x faster than `RRegex`
91
-
92
- | benckmarks | benckmarks |
93
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
94
- | [![Simple IP](./img/rregex-vs-native_-simple-ip.png)](https://jsbenchmark.com/#eyJjYXNlcyI6W3siaWQiOiJlZl9VbGJvYThpRGNYeGM3VUl4YnMiLCJjb2RlIjoiREFUQS5tYXRjaCgnKD86KD86MjVbMC01XXwyWzAtNF1bMC05XXxbMDFdP1swLTldWzAtOV0pXFxcXC4pezN9KD86MjVbMC01XXwyWzAtNF1bMC05XXxbMDFdP1swLTldWzAtOV0pJykiLCJkZXBlbmRlbmNpZXMiOltdLCJuYW1lIjoiUmVnRXhwOiBJUCJ9LHsiaWQiOiI0QkxuZmtPd0p4ZTZhQ0NSVmpIOVUiLCJjb2RlIjoibmV3IHJyZWdleC5SUmVnZXgoXCIoPzooPzoyNVswLTVdfDJbMC00XVswLTldfFswMV0_WzAtOV1bMC05XSlcXFxcLil7M30oPzoyNVswLTVdfDJbMC00XVswLTldfFswMV0_WzAtOV1bMC05XSlcIikuZmluZChEQVRBKSIsImRlcGVuZGVuY2llcyI6W10sIm5hbWUiOiJSUmVnZXg6IElQIn1dLCJjb25maWciOnsibmFtZSI6IlJSZWdleCB2cyBOYXRpdmU6IElQIiwicGFyYWxsZWwiOnRydWUsImdsb2JhbFRlc3RDb25maWciOnsiZGVwZW5kZW5jaWVzIjpbeyJ1cmwiOiJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL3JyZWdleEAxLjEwLjEwL2xpYi93ZWIubWluLmpzIiwibmFtZSI6InJyZWdleCIsImVzbSI6dHJ1ZX1dfSwiZGF0YUNvZGUiOiJjb25zdCB3cmVzID0gYXd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ZGF0YS5zbGljZSgwLCBNYXRoLmZsb29yKGRhdGEubGVuZ3RoLzUpKSJ9fQ) |
96
-
97
- > **Note:** In order to compare with native regex these benchmarks follow the [`mariomka/regex-benchmark`](https://github.com/mariomka/regex-benchmark) structure
61
+ **TL;DR:** use the native `RegExp` unless you need a feature of `rregex`. `rregex` wins only when it has to scan the whole input and the pattern makes `RegExp` backtrack.
62
+
63
+ ### Results
64
+
65
+ Each case compiles the pattern once, before the benchmark, and runs one call on the same 619K-char input (10% of [`test/__data__/input-text.txt`](./test/__data__/input-text.txt), from [`mariomka/regex-benchmark`](https://github.com/mariomka/regex-benchmark)). Lower time is better. The ratio is `RRegex` time ÷ `RegExp` time: below 1× means `rregex` is faster.
66
+
67
+ | pattern | operation | `RegExp` Node | `RRegex` Node | ratio | `RegExp` Chrome | `RRegex` Chrome | ratio |
68
+ | ------- | ------------ | ------------: | ------------: | --------: | --------------: | --------------: | --------: |
69
+ | email | `new` | — | 521 µs | — | — | — | — |
70
+ | email | `isMatch` | 238 µs | 513 µs | 2.2× | 238 µs | 748 µs | 3.1× |
71
+ | email | `find` | 239 µs | 509 µs | 2.1× | 236 µs | 676 µs | 2.9× |
72
+ | email | `findAll` | 4.41 ms | 558 µs | **0.13×** | 4.52 ms | 715 µs | **0.16×** |
73
+ | email | `replaceAll` | 4.39 ms | 801 µs | **0.18×** | 4.47 ms | 1.06 ms | **0.24×** |
74
+ | ip | `new` | — | 92 µs | — | — | — | — |
75
+ | ip | `isMatch` | 35.6 µs | 747 µs | 21× | 35.4 µs | 921 µs | 26× |
76
+ | ip | `find` | 35.8 µs | 752 µs | 21× | 35.5 µs | 919 µs | 26× |
77
+ | ip | `findAll` | 35.0 µs | 759 µs | 22× | 35.1 µs | 913 µs | 26× |
78
+ | ip | `replaceAll` | 34.8 µs | 968 µs | 28× | 35.4 µs | 1.33 ms | 38× |
79
+ | uri | `new` | — | 257 µs | — | — | — | — |
80
+ | uri | `isMatch` | 400 ns | 513 µs | 1,284× | 330 ns | 703 µs | 2,132× |
81
+ | uri | `find` | 398 ns | 517 µs | 1,301× | 394 ns | 704 µs | 1,786× |
82
+ | uri | `findAll` | 3.61 ms | 788 µs | **0.22×** | 3.56 ms | 963 µs | **0.27×** |
83
+ | uri | `replaceAll` | 3.50 ms | 884 µs | **0.25×** | 3.60 ms | 1.24 ms | **0.34×** |
84
+ | set | `new` | — | 654 µs | — | — | — | — |
85
+ | set | `matches` | 276 µs | 1.93 ms | 7.0× | 280 µs | 2.09 ms | 7.5× |
86
+
87
+ > Node v24.19.0 and Chrome 150 on an Apple M4 Pro, `regex` 1.13.1. The `RegExp` equivalent of `findAll` is `Array.from(text.matchAll(re))`, of `replaceAll` is `text.replaceAll(re, '-')`, and of `set: matches` is one `test()` call for each pattern. `RegExp` has no `new` case: it compiles the pattern on first use.
88
+
89
+ <picture>
90
+ <source media="(prefers-color-scheme: dark)" srcset="./img/rregex-vs-native-email-dark.svg" />
91
+ <img alt="RRegex vs RegExp: email, in Chrome" src="./img/rregex-vs-native-email-light.svg" />
92
+ </picture>
93
+ <picture>
94
+ <source media="(prefers-color-scheme: dark)" srcset="./img/rregex-vs-native-uri-dark.svg" />
95
+ <img alt="RRegex vs RegExp: URI, in Chrome" src="./img/rregex-vs-native-uri-light.svg" />
96
+ </picture>
97
+ <picture>
98
+ <source media="(prefers-color-scheme: dark)" srcset="./img/rregex-vs-native-ip-dark.svg" />
99
+ <img alt="RRegex vs RegExp: IP, in Chrome" src="./img/rregex-vs-native-ip-light.svg" />
100
+ </picture>
101
+ <picture>
102
+ <source media="(prefers-color-scheme: dark)" srcset="./img/rregex-vs-native-set-dark.svg" />
103
+ <img alt="RRegexSet vs RegExp: set, in Chrome" src="./img/rregex-vs-native-set-light.svg" />
104
+ </picture>
105
+
106
+ ### Conclusions
107
+
108
+ - **Each call has a cost before matching starts.** `rregex` copies the input from a JavaScript string (UTF-16) into the WebAssembly memory as UTF-8. On this input that copy takes about 0.5 ms on Node and 0.7 ms on Chrome. `new RRegex('^x').isMatch(text)` takes the same time as the other `isMatch` cases. The cost grows with the input length. On a 1K-char input, an `isMatch` call takes about 2 µs.
109
+ - **`RegExp` wins when the call can stop early.** `isMatch` and `find` stop at the first match. The first URI is at char 55, so `RegExp` returns in less than 1 µs and `rregex` is more than 1,000× slower. The difference is smaller when the first match is far from the start (email: 2–3×). The input contains no IP address, but `RegExp` rejects each position quickly and scans all of the input in 35 µs, less than a tenth of the time of the copy into WebAssembly.
110
+ - **`rregex` wins on full scans with backtracking patterns.** `findAll` and `replaceAll` must read all of the input. With the email and URI patterns, `RegExp` tries a match at almost every position and takes 3.5–4.5 ms. The Rust engine finishes in linear time, so `rregex` is 3–8× faster, even with the copy cost.
111
+ - **`RRegexSet` does not make a set of patterns faster.** On this input, `matches` is about 7× slower than one `test()` call for each pattern. Use it when you need the matches of many patterns in a single pass, not for speed.
112
+ - **Compile once.** `new RRegex` takes 0.1–0.5 ms and `new RRegexSet` 0.65 ms, about the same as one call. Keep the instance and use it again, and call `free()` when you do not need it.
113
+ - **Node and Chrome show the same pattern.** Chrome is up to 50% slower on the `rregex` cases. The `RegExp` times are almost the same in the two runtimes.
114
+
115
+ The time of `rregex` is predictable: the time to copy the input plus a time that is linear in the input length. The Rust engine has no catastrophic backtracking, so you can also use it with patterns from users that you do not trust. The time of `RegExp` depends on the pattern and on the input. It can be much faster or much slower than `rregex`.
116
+
117
+ > [!NOTE]
118
+ > `\w` matches only ASCII chars in `RegExp`, and Unicode chars in `rregex`. The patterns give the same matches on this input.
119
+
120
+ ### Run the benchmarks
121
+
122
+ - **Browser:** run `pnpm build`, then `pnpm test:browser`, and open <http://localhost:8080/test/browser/bench.html>. The page shows the charts above and gives a Markdown table and SVG/PNG images of the results.
123
+ - **Node:** the same cases are in [`bin/bench-cases.mjs`](./bin/bench-cases.mjs). [`bin/bench-compare.mjs`](./bin/bench-compare.mjs) compares two builds of `rregex` with each other, and CI uses it on each pull request.
98
124
 
99
125
  ## Known Issues
100
126
 
package/lib/cf.d.ts CHANGED
@@ -1268,10 +1268,10 @@ export interface InitOutput {
1268
1268
  readonly rregex_syntax: (a: number) => [number, number, number];
1269
1269
  readonly rregex_toString: (a: number) => [number, number];
1270
1270
  readonly __wbg_rregexset_free: (a: number, b: number) => void;
1271
- readonly escape: (a: number, b: number) => [number, number];
1272
1271
  readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
1273
1272
  readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
1274
1273
  readonly rregexset_new: (a: any) => [number, number, number];
1274
+ readonly escape: (a: number, b: number) => [number, number];
1275
1275
  readonly __wbindgen_exn_store: (a: number) => void;
1276
1276
  readonly __externref_table_alloc: () => number;
1277
1277
  readonly __wbindgen_export_2: WebAssembly.Table;
package/lib/rregex.wasm CHANGED
Binary file
@@ -22,10 +22,10 @@ export const rregex_splitn: (a: number, b: number, c: number, d: number) => [num
22
22
  export const rregex_syntax: (a: number) => [number, number, number];
23
23
  export const rregex_toString: (a: number) => [number, number];
24
24
  export const __wbg_rregexset_free: (a: number, b: number) => void;
25
- export const escape: (a: number, b: number) => [number, number];
26
25
  export const rregexset_isMatch: (a: number, b: number, c: number) => number;
27
26
  export const rregexset_matches: (a: number, b: number, c: number) => [number, number];
28
27
  export const rregexset_new: (a: any) => [number, number, number];
28
+ export const escape: (a: number, b: number) => [number, number];
29
29
  export const __wbindgen_exn_store: (a: number) => void;
30
30
  export const __externref_table_alloc: () => number;
31
31
  export const __wbindgen_export_2: WebAssembly.Table;
@@ -1271,10 +1271,10 @@ declare interface InitOutput {
1271
1271
  readonly rregex_syntax: (a: number) => [number, number, number];
1272
1272
  readonly rregex_toString: (a: number) => [number, number];
1273
1273
  readonly __wbg_rregexset_free: (a: number, b: number) => void;
1274
- readonly escape: (a: number, b: number) => [number, number];
1275
1274
  readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
1276
1275
  readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
1277
1276
  readonly rregexset_new: (a: any) => [number, number, number];
1277
+ readonly escape: (a: number, b: number) => [number, number];
1278
1278
  readonly __wbindgen_exn_store: (a: number) => void;
1279
1279
  readonly __externref_table_alloc: () => number;
1280
1280
  readonly __wbindgen_export_2: WebAssembly.Table;
package/lib/types.d.ts CHANGED
@@ -1268,10 +1268,10 @@ export interface InitOutput {
1268
1268
  readonly rregex_syntax: (a: number) => [number, number, number];
1269
1269
  readonly rregex_toString: (a: number) => [number, number];
1270
1270
  readonly __wbg_rregexset_free: (a: number, b: number) => void;
1271
- readonly escape: (a: number, b: number) => [number, number];
1272
1271
  readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
1273
1272
  readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
1274
1273
  readonly rregexset_new: (a: any) => [number, number, number];
1274
+ readonly escape: (a: number, b: number) => [number, number];
1275
1275
  readonly __wbindgen_exn_store: (a: number) => void;
1276
1276
  readonly __externref_table_alloc: () => number;
1277
1277
  readonly __wbindgen_export_2: WebAssembly.Table;
package/lib/web.d.ts CHANGED
@@ -1268,10 +1268,10 @@ export interface InitOutput {
1268
1268
  readonly rregex_syntax: (a: number) => [number, number, number];
1269
1269
  readonly rregex_toString: (a: number) => [number, number];
1270
1270
  readonly __wbg_rregexset_free: (a: number, b: number) => void;
1271
- readonly escape: (a: number, b: number) => [number, number];
1272
1271
  readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
1273
1272
  readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
1274
1273
  readonly rregexset_new: (a: any) => [number, number, number];
1274
+ readonly escape: (a: number, b: number) => [number, number];
1275
1275
  readonly __wbindgen_exn_store: (a: number) => void;
1276
1276
  readonly __externref_table_alloc: () => number;
1277
1277
  readonly __wbindgen_export_2: WebAssembly.Table;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rregex",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
4
4
  "description": "A dependency-free WebAssembly build of Rust Regex for Javascript",
5
5
  "private": false,
6
6
  "type": "module",
@@ -8,6 +8,9 @@
8
8
  "types": "./lib/commonjs.d.cts",
9
9
  "module": "./lib/esm.mjs",
10
10
  "browser": "./lib/web.js",
11
+ "files": [
12
+ "lib"
13
+ ],
11
14
  "exports": {
12
15
  "./package.json": "./package.json",
13
16
  ".": {
@@ -40,6 +43,7 @@
40
43
  "setup": "./bin/install.sh",
41
44
  "build": "./bin/build.sh",
42
45
  "test": "node --test test/node.test.mjs",
46
+ "test:browser": "node test/browser/serve.mjs",
43
47
  "test:rs": "wasm-pack test",
44
48
  "semantic-release": "semantic-release"
45
49
  },
@@ -100,6 +104,21 @@
100
104
  "range": "1.9.x",
101
105
  "channel": "1.9.x"
102
106
  },
107
+ {
108
+ "name": "1.10.x",
109
+ "range": "1.10.x",
110
+ "channel": "1.10.x"
111
+ },
112
+ {
113
+ "name": "1.11.x",
114
+ "range": "1.11.x",
115
+ "channel": "1.11.x"
116
+ },
117
+ {
118
+ "name": "1.12.x",
119
+ "range": "1.12.x",
120
+ "channel": "1.12.x"
121
+ },
103
122
  {
104
123
  "name": "master"
105
124
  }
package/jsr.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "name": "@rregex/rregex",
3
- "version": "0.0.0-development",
4
- "description": "A dependency-free WebAssembly build of Rust Regex for Javascript",
5
- "exports": "./lib/esm.mjs",
6
- "publish": {
7
- "include": [
8
- "LICENSE",
9
- "README.md",
10
- "jsr.json",
11
- "lib/rregex.wasm",
12
- "lib/rregex.wasm.d.ts",
13
- "lib/esm.mjs",
14
- "lib/esm.d.ts"
15
- ]
16
- }
17
- }