Skip to content

Commit e7c1985

Browse files
committed
Update benchmark results
1 parent ce793cc commit e7c1985

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

DEVELOPMENT.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ When we want test `cargo i18n` in local dev, we can:
55
```bash
66
$ cargo run -- i18n ~/work/some-rust-project
77
```
8+
9+
## How to release
10+
11+
1. Update `Cargo.toml` version
12+
2. Run `make release` to build and publish to crates.io

README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ You can also split the each language into difference files, and you can choise (
113113

114114
```yml
115115
_version: 1
116-
hello: 'Hello world'
117-
messages.hello: 'Hello, %{name}'
118-
t_4Cct6Q289b12SkvF47dXIx: 'Hello, %{name}'
116+
hello: "Hello world"
117+
messages.hello: "Hello, %{name}"
118+
t_4Cct6Q289b12SkvF47dXIx: "Hello, %{name}"
119119
```
120120
121121
Or use JSON or TOML format, just rename the file to `en.json` or `en.toml`, and the content is like this:
@@ -421,18 +421,19 @@ $ RUST_I18N_DEBUG=1 cargo build
421421
422422
## Benchmark
423423
424-
Benchmark [`t!`] method, result on Apple M1:
424+
Benchmark [`t!`] method, result on MacBook Pro (2023, Apple M3):
425425
426426
```bash
427-
t time: [58.274 ns 60.222 ns 62.390 ns]
428-
t_with_locale time: [55.395 ns 57.106 ns 59.081 ns]
429-
t_with_args time: [167.46 ns 170.94 ns 175.64 ns]
430-
t_with_args (str) time: [164.85 ns 165.91 ns 167.41 ns]
431-
t_with_args (many) time: [444.04 ns 452.17 ns 463.44 ns]
432-
t_with_threads time: [414.26 ns 422.97 ns 433.53 ns]
427+
t time: [32.637 ns 33.139 ns 33.613 ns]
428+
t_with_locale time: [24.616 ns 24.812 ns 25.071 ns]
429+
t_with_args time: [128.70 ns 128.97 ns 129.24 ns]
430+
t_with_args (str) time: [129.48 ns 130.08 ns 130.76 ns]
431+
t_with_args (many) time: [370.28 ns 374.46 ns 380.56 ns]
432+
t_with_threads time: [38.619 ns 39.506 ns 40.419 ns]
433+
t_lorem_ipsum time: [33.867 ns 34.286 ns 34.751 ns]
433434
```
434435
435-
The result `101 ns (0.0001 ms)` means if there have 10K translate texts, it will cost 1ms.
436+
The result `101 ns (0.0001 ms)` means if there have **10K** translate texts, it will cost `1ms`.
436437
437438
## License
438439

0 commit comments

Comments
 (0)