From fadf17320ac5934b6b3a91634a8ec6570306106b Mon Sep 17 00:00:00 2001 From: "http://www.digital-scurf.org/" Date: Thu, 29 Jan 2015 09:52:23 -0400 Subject: missing timezone leads to excessive stat() --- ...ithout_timezone__44___excessive_statting_causes_slowness.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/bugs/without_timezone__44___excessive_statting_causes_slowness.mdwn diff --git a/doc/bugs/without_timezone__44___excessive_statting_causes_slowness.mdwn b/doc/bugs/without_timezone__44___excessive_statting_causes_slowness.mdwn new file mode 100644 index 000000000..3b70e13f6 --- /dev/null +++ b/doc/bugs/without_timezone__44___excessive_statting_causes_slowness.mdwn @@ -0,0 +1,9 @@ +If the TZ environment variable is unset *and* the 'timezone' entry in setup is unset, then libc defaults to /etc/localtime which is all well and good, but it causes it to stat() that file for every strftime or similar. This results in somewhere in the region of 300k calls to stat(/etc/localtime) for my 600 page ikiwiki and introduces appreciable slowness into builds. + +If either of TZ or timezone is set, then instead it is believed and /etc/localtime is not repeatedly stat()d, even if TZ or timezone is set to ":/etc/localtime". + +A conversation with smcv on IRC suggested: + +> `it just needs "elsif (-e /etc/localtime) { $ENV{TZ} = ':/etc/localtime'; } else { $ENV{TZ} = 'GMT'; } or some such` + +relating to the processing of `$ENV{TZ}` and `$config{timezone}` in `Ikiwiki.pm` -- cgit v1.2.3