@formatjs/icu-messageformat-parser 3.4.0 → 3.5.1
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 +22 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@ Hand-written ICU MessageFormat parser with compatible output as
|
|
|
4
4
|
[`intl-messageformat-parser`](https://www.npmjs.com/package/intl-messageformat-parser)
|
|
5
5
|
but 6 - 10 times as fast.
|
|
6
6
|
|
|
7
|
+
## Benchmarks
|
|
8
|
+
|
|
9
|
+
### JavaScript/TypeScript Parser
|
|
10
|
+
|
|
7
11
|
```
|
|
8
12
|
$ bazel run //packages/icu-messageformat-parser/benchmark:benchmark
|
|
9
13
|
complex_msg AST length 2599
|
|
@@ -11,8 +15,22 @@ normal_msg AST length 400
|
|
|
11
15
|
simple_msg AST length 79
|
|
12
16
|
string_msg AST length 36
|
|
13
17
|
|
|
14
|
-
complex_msg
|
|
15
|
-
normal_msg
|
|
16
|
-
simple_msg
|
|
17
|
-
string_msg
|
|
18
|
+
complex_msg: 23.85 µs (41,931 ops/sec)
|
|
19
|
+
normal_msg: 3.27 µs (306,177 ops/sec)
|
|
20
|
+
simple_msg: 0.60 µs (1,675,766 ops/sec)
|
|
21
|
+
string_msg: 0.32 µs (3,113,287 ops/sec)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Rust Parser (WASM)
|
|
25
|
+
|
|
26
|
+
The Rust parser (optimized build) is **2.6-3.7x faster** than the JavaScript parser:
|
|
27
|
+
|
|
18
28
|
```
|
|
29
|
+
$ bazel run -c opt //crates/icu_messageformat_parser:comparison_bench
|
|
30
|
+
complex_msg: 9.22 µs (2.59x faster than JS)
|
|
31
|
+
normal_msg: 1.14 µs (2.87x faster than JS)
|
|
32
|
+
simple_msg: 163 ns (3.68x faster than JS)
|
|
33
|
+
string_msg: 118 ns (2.71x faster than JS)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The Rust parser is also 10-11% faster than the SWC ICU MessageFormat parser.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/icu-messageformat-parser",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"tslib": "^2.8.1",
|
|
15
|
-
"@formatjs/
|
|
16
|
-
"@formatjs/
|
|
15
|
+
"@formatjs/icu-skeleton-parser": "2.1.1",
|
|
16
|
+
"@formatjs/ecma402-abstract": "3.1.1"
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|