[Bug 1669055] Re: TZ is not set by default

Seth Arnold 1669055 at bugs.launchpad.net
Wed Mar 1 22:46:38 UTC 2017


Hello, thanks for this report; I suspect this would prevent the Time And
Date Settings... dialog box from changing the timezone for already-
running processes. It might make sense for very stationary systems but
wouldn't be very friendly for travelers with more mobile machines.

Thanks

** Changed in: shadow (Ubuntu)
       Status: New => Opinion

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/1669055

Title:
  TZ is not set by default

Status in shadow package in Ubuntu:
  Opinion

Bug description:
  It seems that unsetting the environment variable TZ there is a huge
  performance penalty calling some glibc functions, eg. time()

  this has been documented here:

  https://blog.packagecloud.io/eng/2017/02/21/set-environment-variable-
  save-thousands-of-system-calls/

  and I can confirm it on an amd64 system running Yakkety:

  $ cat time.c
  #include <time.h>

  int main(int argc, char *argv[])
  {
          int i = 0;
          time_t timep;

          for (i = 0; i < 10000000; i++) {
                  time(&timep);
                  localtime(&timep);
          }

          return 0;
  }
  $ gcc -Wall -O3 time.c -o time
  $ time ./time

  real    0m7.102s
  user    0m2.060s
  sys     0m5.040s
  $ time TZ=:/etc/localtime ./time

  real    0m0.952s
  user    0m0.948s
  sys     0m0.000s
  $

  I've set TZ in /etc/environment to have it globally defined.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1669055/+subscriptions



More information about the foundations-bugs mailing list