diff options
author | Jean Boussier <[email protected]> | 2024-08-30 13:04:11 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2024-09-05 19:23:12 +0200 |
commit | 57e3fc32ea83e55d40f4cc6c3e437d485c506d34 (patch) | |
tree | 94ec6a5eb9f9e5a53715bf4dcd475f020fba29c7 /spec/ruby/library/time/shared/xmlschema.rb | |
parent | d4de8aef374310d318b27c910f2fb562da170641 (diff) |
Move Time#xmlschema in core and optimize it
[Feature #20707]
Converting Time into RFC3339 / ISO8601 representation is an significant
hotspot for applications that serialize data in JSON, XML or other formats.
By moving it into core we can optimize it much further than what `strftime` will
allow.
```
compare-ruby: ruby 3.4.0dev (2024-08-29T13:11:40Z master 6b08a50a62) +YJIT [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-08-30T13:17:32Z native-xmlschema 34041ff71f) +YJIT [arm64-darwin23]
warming up......
| |compare-ruby|built-ruby|
|:-----------------------|-----------:|---------:|
|time.xmlschema | 1.087M| 5.190M|
| | -| 4.78x|
|utc_time.xmlschema | 1.464M| 6.848M|
| | -| 4.68x|
|time.xmlschema(6) | 859.960k| 4.646M|
| | -| 5.40x|
|utc_time.xmlschema(6) | 1.080M| 5.917M|
| | -| 5.48x|
|time.xmlschema(9) | 893.909k| 4.668M|
| | -| 5.22x|
|utc_time.xmlschema(9) | 1.056M| 5.707M|
| | -| 5.40x|
```
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11510
Diffstat (limited to 'spec/ruby/library/time/shared/xmlschema.rb')
-rw-r--r-- | spec/ruby/library/time/shared/xmlschema.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/ruby/library/time/shared/xmlschema.rb b/spec/ruby/library/time/shared/xmlschema.rb index 44d33cda7e..831d8509a7 100644 --- a/spec/ruby/library/time/shared/xmlschema.rb +++ b/spec/ruby/library/time/shared/xmlschema.rb @@ -1,4 +1,4 @@ -describe :time_xmlschema, shared: true do +describe :time_library_xmlschema, shared: true do it "parses ISO-8601 strings" do t = Time.utc(1985, 4, 12, 23, 20, 50, 520000) s = "1985-04-12T23:20:50.52Z" |