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
on unix systems, look for /etc/timezone first before /etc/localtime #3
on unix systems, look for /etc/timezone first before /etc/localtime #3
Conversation
On ubuntu systems (Etch and later), /etc/localtime is a copy of /usr/share/zoneinfo/$zonefile, which means DateTime::TimeZone::Local::Unix spends a lot of time looking for the file that matches it, and it takes a LONG time (especially when done many times for a single page load!); whereas /etc/timezone also exists, and this is a simple file that contains the name of the timezone, so checking for this file first would be much faster.
on unix systems, look for /etc/timezone first before /etc/localtime
I don't like this change because standard library does not consider /etc/timezone at all. So if the /etc/timezone does not match /etc/localtime, this Perl code will not match the system. |
On Mon, Nov 03, 2014 at 03:46:45AM -0800, ppisar wrote:
That sounds like a misconfigured system to me. The ubuntu documentation |
On Mon, Nov 03, 2014 at 09:32:19AM -0800, Karen Etheridge wrote:
This is specific for Ubuntu. Now read http://man7.org/linux/man-pages/man3/tzset.3.html how any -- Petr |
On Mon, Nov 03, 2014 at 11:35:12PM -0800, ppisar wrote:
Do you have a suggestion for a solution? |
On Tue, Nov 04, 2014 at 08:44:57AM -0800, Karen Etheridge wrote:
(The patch is just a last reason fall-back, but I'm going to remove the -- Petr |
It occurs to me that this bit of the process:
...really should be only done once per process, and the result cached locally in DateTime::TimeZone::Local::Unix. There's no need to keep parsing the file multiple times. |
On ubuntu systems (Etch and later), /etc/localtime is a copy of
/usr/share/zoneinfo/$zonefile, which means DateTime::TimeZone::Local::Unix
spends a lot of time looking for the file that matches it, and it takes a LONG
time (especially when done many times for a single page load!); whereas
/etc/timezone also exists, and this is a simple file that contains the name of
the timezone, so checking for this file first would be much faster.