The Wayback Machine - https://web.archive.org/web/20201226153100/https://github.com/github/homebrew-bootstrap/pull/75
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the default timezone to UTC #75

Open
wants to merge 1 commit into
base: master
from

Conversation

@jeffrafter
Copy link

@jeffrafter jeffrafter commented Mar 11, 2019

This reduces the number of non-UTC tz dependent time conversions which should make local development much closer to how the actual server runs. Also, UTC conversions are much faster (up to 7X faster) than time zone dependent conversions.

Benchmark.ips do |x|
  x.report "at" do |times|
    Time.at(1)
  end

  x.report "local" do |times|
    Time.local(2001, 1, 1, 1, 1, 1, 1)
  end

  x.report "utc" do |times|
    Time.utc(2001, 1, 1, 1, 1, 1, 1)
  end

  x.compare!
end

Results in:

$ ruby script/benchmark
Warming up --------------------------------------
                  at   225.583k i/100ms
               local    24.474k i/100ms
                 utc    57.434k i/100ms
Calculating -------------------------------------
                  at    221.967B (±10.8%) i/s -    507.901B
               local      6.326B (±17.7%) i/s -     27.582B in   4.738513s
                 utc     41.447B (±35.5%) i/s -    146.765B

Comparison:
                  at: 221966772987.2 i/s
                 utc: 41446699159.0 i/s - 5.36x  slower
               local: 6325793112.5 i/s - 35.09x  slower
This reduces the number of non-UTC tz dependent time conversions which should make local development much closer to how the actual server runs. Also, UTC conversions are much faster (up to 3X faster) than time zone dependent conversions.
@jeffrafter
Copy link
Author

@jeffrafter jeffrafter commented Aug 12, 2019

It feels like this pull request has gone stale... should we close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.