]> Savannah Git Hosting - gnulib.git/commit
mktime: speed up DEBUG_MKTIME benchmarks
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 May 2016 19:49:21 +0000 (12:49 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 May 2016 00:27:04 +0000 (17:27 -0700)
commite8cf92310a7f6323bc43c0143bfc3da66ef4a1c2
tree90c81f68bbf7a36d8dbba6eec839bc880b97888e
parentb4a3de1dee4dde76e010a34c25aeb9c160d564d7
mktime: speed up DEBUG_MKTIME benchmarks

Call tzset just once, at the start, rather than for every test
case.  This lets us measure the CPU cost of mktime as opposed to
that of tzset.  This is relevant when TZ is not set and glibc is
being used.  This speeds up tests by a factor of 40 on my Fedora
23 x86-64 platform.
* lib/mktime.c (main) [DEBUG_MKTIME]: Call localtime at the start,
to call tzset and as a sanity check.  Later on, use localtime_r
instead of localtime.
ChangeLog
lib/mktime.c