Closed zhuxiujia closed 2 years ago
Merging #17 (273f795) into main (d697efc) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## main #17 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 617 666 +49
=========================================
+ Hits 617 666 +49
Impacted Files | Coverage Δ | |
---|---|---|
src/date.rs | 100.00% <100.00%> (ø) |
|
src/datetime.rs | 100.00% <100.00%> (ø) |
|
src/lib.rs | 100.00% <100.00%> (ø) |
|
src/time.rs | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update d697efc...273f795. Read the comment docs.
thanks so much 🙏 🚀 .
impl for #16 I think the time is also important to the performance of the Format string, such as crates the httpdate, It directly affects HTTP Web framework performance
[bench]
fn bench_format_time(bench: &mut Bencher) { let time = Time{ hour: 10, minute: 11, second: 12, microsecond: 11 }; bench.iter(|| { time.to_string(); }) }
[bench]
fn bench_format_date_time(bench: &mut Bencher) { let date = DateTime{ date: Date { year: 2022, month: 7, day: 10 }, time: Time { hour: 0, minute: 0, second: 0, microsecond: 0 }, offset: Some(60) }; bench.iter(|| { date.to_string(); }) }
test bench_format_date ... bench: 149 ns/iter (+/- 3) test bench_format_time ... bench: 231 ns/iter (+/- 4) test bench_format_date_time ... bench: 283 ns/iter (+/- 3) //offset None test bench_format_date_time ... bench: 326 ns/iter (+/- 6) //offset Some(60)
test bench_format_date ... bench: 51 ns/iter (+/- 0) test bench_format_time ... bench: 53 ns/iter (+/- 3) test bench_format_date_time ... bench: 50 ns/iter (+/- 0) //offset None test bench_format_date_time ... bench: 115 ns/iter (+/- 0) //offset Some(60)
f.write_str(std::str::from_utf8(&buf[..]).unwrap())?;