timezone 1.3.8 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.markdown +4 -0
- data/benchmark.rb +16 -29
- data/data/Pacific/Fiji +2 -2
- data/lib/timezone/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7470e7b4c5fd9cd721f958813e514054fbd3060dc4f30c3e4a2468a2185481d0
|
4
|
+
data.tar.gz: bfa1e661ff97f16b894083ca34772df64a8493a2d710301b89a515ce45918eda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ac5018bf083eab0ea4997624b66d56aeb7721125eac51dd921d8b6043b2660e0eacd3d728a15aa2d154962d61cc175307d141123a41e8129c39b94f8a99ba5
|
7
|
+
data.tar.gz: 12e1590da7300b0aa84efd53c96b0a092a250cc674814e1c66b0518fccfb99955a7615b1cb3866f39c25c5fc781176dfb4b76c8238947e532740dc93f98cbb57
|
data/CHANGES.markdown
CHANGED
data/benchmark.rb
CHANGED
@@ -4,42 +4,29 @@
|
|
4
4
|
require 'benchmark'
|
5
5
|
require 'timezone'
|
6
6
|
|
7
|
-
def load_tz(timezone)
|
8
|
-
Timezone.fetch(timezone)
|
9
|
-
end
|
10
|
-
|
11
7
|
puts 'Loading timezones'
|
12
8
|
|
13
|
-
LOAD_ITERATIONS = 1_000
|
14
9
|
Benchmark.bm do |x|
|
15
|
-
x.report('la') {
|
16
|
-
x.report('hk') {
|
17
|
-
end
|
18
|
-
|
19
|
-
def calc_local(timezone)
|
20
|
-
timezone.time(Time.utc(3000, 1, 1))
|
10
|
+
x.report('la') { 10_000.times { Timezone.fetch('America/Los_Angeles') } }
|
11
|
+
x.report('hk') { 10_000.times { Timezone.fetch('Asia/Hong_Kong') } }
|
21
12
|
end
|
22
13
|
|
23
|
-
|
24
|
-
|
25
|
-
LOCAL_ITERATIONS = 10_000
|
26
|
-
Benchmark.bm do |x|
|
27
|
-
timezone = Timezone.fetch('America/Los_Angeles')
|
28
|
-
x.report('la') { LOCAL_ITERATIONS.times { calc_local(timezone) } }
|
29
|
-
timezone = Timezone.fetch('Asia/Hong_Kong')
|
30
|
-
x.report('hk') { LOCAL_ITERATIONS.times { calc_local(timezone) } }
|
14
|
+
def calc(method, timezone, time)
|
15
|
+
timezone.public_send(method, time)
|
31
16
|
end
|
32
17
|
|
33
|
-
def
|
34
|
-
|
18
|
+
def bench(iterations, method)
|
19
|
+
Benchmark.bm do |x|
|
20
|
+
time = Time.utc(3000, 1, 1)
|
21
|
+
timezone = Timezone.fetch('America/Los_Angeles')
|
22
|
+
x.report('la') { iterations.times { calc(method, timezone, time) } }
|
23
|
+
timezone = Timezone.fetch('Asia/Hong_Kong')
|
24
|
+
x.report('hk') { iterations.times { calc(method, timezone, time) } }
|
25
|
+
end
|
35
26
|
end
|
36
27
|
|
37
|
-
puts 'Calculating
|
28
|
+
puts 'Calculating LOCAL (#time)'
|
29
|
+
bench(10_000, :time)
|
38
30
|
|
39
|
-
|
40
|
-
|
41
|
-
timezone = Timezone.fetch('America/Los_Angeles')
|
42
|
-
x.report('la') { UTC_ITERATIONS.times { calc_utc(timezone) } }
|
43
|
-
timezone = Timezone.fetch('Asia/Hong_Kong')
|
44
|
-
x.report('hk') { UTC_ITERATIONS.times { calc_utc(timezone) } }
|
45
|
-
end
|
31
|
+
puts 'Calculating UTC (#local_to_utc)'
|
32
|
+
bench(10_000, :local_to_utc)
|
data/data/Pacific/Fiji
CHANGED
data/lib/timezone/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timezone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pan Thomakos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -747,7 +747,7 @@ requirements: []
|
|
747
747
|
rubygems_version: 3.1.2
|
748
748
|
signing_key:
|
749
749
|
specification_version: 4
|
750
|
-
summary: timezone-1.3.
|
750
|
+
summary: timezone-1.3.9
|
751
751
|
test_files:
|
752
752
|
- test/data/Helsinki_rules_without_timestamps.json
|
753
753
|
- test/data/asia
|