mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Refactor Time#xmlschema
And refine uncommon date cases. # Iteration per second (i/s) | |compare-ruby|built-ruby| |:---------------------------|-----------:|---------:| |time.xmlschema | 5.020M| 14.192M| | | -| 2.83x| |utc_time.xmlschema | 6.454M| 15.331M| | | -| 2.38x| |time.xmlschema(6) | 4.216M| 10.043M| | | -| 2.38x| |utc_time.xmlschema(6) | 5.486M| 10.592M| | | -| 1.93x| |time.xmlschema(9) | 4.294M| 10.340M| | | -| 2.41x| |utc_time.xmlschema(9) | 4.784M| 10.909M| | | -| 2.28x| |fraction_sec.xmlschema(10) | 366.982k| 3.406M| | | -| 9.28x| |future_time.xmlschema | 994.595k| 15.853M| | | -| 15.94x|
This commit is contained in:
parent
b811a9a097
commit
7be1fafe58
Notes:
git
2024-09-23 06:17:39 +00:00
3 changed files with 81 additions and 49 deletions
|
@ -14,6 +14,8 @@ prelude: |
|
|||
end
|
||||
time = Time.now
|
||||
utc_time = Time.now.utc
|
||||
fraction_sec = Time.at(123456789.quo(9999999999)).getlocal("+09:00")
|
||||
future_time = Time.utc(10000)
|
||||
benchmark:
|
||||
- time.xmlschema
|
||||
- utc_time.xmlschema
|
||||
|
@ -21,3 +23,5 @@ benchmark:
|
|||
- utc_time.xmlschema(6)
|
||||
- time.xmlschema(9)
|
||||
- utc_time.xmlschema(9)
|
||||
- fraction_sec.xmlschema(10)
|
||||
- future_time.xmlschema
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue