Conversation
We recently instrumented our application to locate the source of the constant cache bumps we were seeing, and tzinfo came up as one of the sources. In production environment, it's detrimental for performance to use lazy loading. It's much better to load everything upfront as part of boot.
|
Which constant(s) are defined when loading a new timezone? |
|
If you use the "ruby datasource" it load the individual ruby definition file from And they all include module TimezoneDefinition #:nodoc:
# Adds class methods to the includee.
#
# @param base [Module] the includee.
def self.append_features(base)
super
base.extend(Format2::TimezoneDefinition::ClassMethods)
base.extend(ClassMethods)
end |
An alternative implementation to #129.
|
Thanks for submitting this. I've implemented something that will achieve the same thing in a slightly different way. Commit 94be919 adds a The implementation avoids the temporary creation of |
|
Thanks @philr, it however is infortunate it's not at least aliased as config.eager_load_namespaces << TZinfo |
|
I wasn't aware of that Rails convention. I've made a further change (c4f177c) to add a |
|
Thank you! That's very helpful. |
We recently instrumented our application to locate the source of the constant cache bumps we were seeing, and tzinfo came up as one of the sources.
In production environment, it's detrimental for performance to use lazy loading. It's much better to load everything upfront as part of boot.