[前][次][番号順一覧][スレッド一覧]

ruby-changes:67956

From: Nobuyoshi <ko1@a...>
Date: Sun, 12 Sep 2021 18:47:28 +0900 (JST)
Subject: [ruby-changes:67956] 11fd3fec53 (master): Add benchmarks to create Time instances

https://git.ruby-lang.org/ruby.git/commit/?id=11fd3fec53

From 11fd3fec534bb626e717a0628a0cf6d6252a0ff4 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 23 Aug 2021 09:57:02 +0900
Subject: Add benchmarks to create Time instances

---
 benchmark/time_new.yml   | 4 ++++
 benchmark/time_parse.yml | 8 ++++++++
 2 files changed, 12 insertions(+)
 create mode 100644 benchmark/time_new.yml
 create mode 100644 benchmark/time_parse.yml

diff --git a/benchmark/time_new.yml b/benchmark/time_new.yml
new file mode 100644
index 0000000..5947dd3
--- /dev/null
+++ b/benchmark/time_new.yml
@@ -0,0 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/time_new.yml#L1
+benchmark:
+  - 'Time.new(2021)'
+  - 'Time.new(2021, 8, 22)'
+  - 'Time.new(2021, 8, 22, in: "+09:00")'
diff --git a/benchmark/time_parse.yml b/benchmark/time_parse.yml
new file mode 100644
index 0000000..a6d6948
--- /dev/null
+++ b/benchmark/time_parse.yml
@@ -0,0 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/time_parse.yml#L1
+prelude: |
+  require 'time'
+  inspect = "2021-08-23 09:57:02 +0900"
+  iso8601 = "2021-08-23T09:57:02+09:00"
+benchmark:
+  - Time.iso8601(iso8601)
+  - Time.parse(iso8601)
+  - Time.parse(inspect)
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]