| Crates.io | china-id |
| lib.rs | china-id |
| version | 0.2.0 |
| created_at | 2023-10-15 15:20:42.382339+00 |
| updated_at | 2025-01-14 03:54:37.559685+00 |
| description | 一个中国身份证号码解析库 |
| homepage | |
| repository | https://github.com/cuipeiyu/china-id |
| max_upload_size | |
| id | 1003900 |
| size | 37,902 |
=======================
图片来源网络
Test Host Apple Mac mini 2023 M2 chip 16GB mem
golang
$ go test -benchmem -run=^$ -bench ^BenchmarkParse$
goos: darwin
goarch: arm64
pkg: github.com/cuipeiyu/china-id
cpu: Apple M3
BenchmarkParse-8 5089683 217.1 ns/op 72 B/op 2 allocs/op
PASS
ok github.com/cuipeiyu/china-id 1.506s
$ cargo bench
Compiling china-id v0.2.0 (/Users/cui/Projects/github.com/cuipeiyu/china-id)
Finished `bench` profile [optimized] target(s) in 1.02s
Running unittests src/lib.rs (target/release/deps/china_id-2b398abde40a8aa0)
running 1 test
test tests::ut_parse ... ignored
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running benches/benchmark.rs (target/release/deps/benchmark-a5b3e825dae2b1bc)
Gnuplot not found, using plotters backend
bench time: [376.95 ns 377.95 ns 378.92 ns]
change: [-11.373% -3.9953% +1.8492%] (p = 0.34 > 0.05)
No change in performance detected.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild