[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc_bugs

Title:DEC C Problem Reporting Forum
Notice:Report DEC C++ problems in TURRIS::C_PLUS_PLUS
Moderator:CXXC::REPETETCHEON
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1299
Total number of notes:6249

1184.0. "localtime() performance with UTC time-based model" by CSC32::D_SANFORD () Thu Aug 01 1996 00:42

T.RTitleUserPersonal
Name
DateLines
1184.1known problemTAVENG::BORISBoris Gubenko, ISEThu Aug 01 1996 03:54100
1184.2the list of the functionsTAVENG::BORISBoris Gubenko, ISEThu Aug 01 1996 07:3911
1184.3also tzset() and wcsftime()TAVENG::BORISBoris Gubenko, ISEThu Aug 01 1996 08:090
1184.4CSC32::D_SANFORDThu Aug 01 1996 19:3217
1184.5TLE::D_SMITHFri Aug 02 1996 07:295
1184.6s/hopefully/definitely/TAVENG::BORISBoris Gubenko, ISEFri Aug 02 1996 09:3433
1184.7Default to 1 or 2, please?WIBBIN::NOYCEPulling weeds, pickin' stonesFri Aug 02 1996 10:154
1184.8I agreeTAVENG::BORISBoris Gubenko, ISEFri Aug 02 1996 11:286
1184.9TLE::D_SMITHI love Digital, but miss DECFri Aug 02 1996 12:084
1184.10Ok, I'll change itTAVENG::BORISBoris Gubenko, ISEFri Aug 02 1996 14:000
1184.11Update from customerCSC32::D_SANFORDWed Sep 11 1996 16:0633
1184.12of courseHNDYMN::MCCARTHYA Quinn Martin ProductionWed Sep 11 1996 18:525
1184.13DEFINE DECC$TZ_CACHE_SIZE 0TLE::D_SMITHLet's just say I like Digital alotFri Sep 27 1996 08:2417
1184.14Fixed in ovms 7.1?CSC32::D_BUSTOSWed Jan 08 1997 12:078
1184.15TLE::D_SMITHDuane Smith -- DEC C RTLWed Jan 08 1997 13:015
1184.16localtime() performance OpenVMS vs. Unix w cache enabledCSC32::D_SANFORDThu Apr 03 1997 16:5930
    OpenVMS Alpha V7.1, DEC C V5.5-002
    Unix V3.2, DEC C++ V5.4

    localtime() is 30 times slower on OpenVMS, with cache enabled (no disk
    I/O), then the equivalent function on Unix.

    Customer is having a problem with the localtime function taking so long 
    to run on their OpenVMS V7.1 system that they can't use their software.  
    They were curious about why they weren't seeing the problem on Unix, so
    they ran some comparisons.  Theyfound that localtime takes 30 times as
    long to run on a VMS machine as on a Unix machine.  By comparison,
    gmtime takes about the same time on both.  Can you please check into
    the reason for the difference in localtime and whether it can be made
    faster on VMS?  We would think they would run about the same on the two
    systems.

    Here is the data they collected, on Alphastation 255/233 machines.  
    Each number is the time, in microseconds, for one call to the function
    in question.  They were collected from runs of 10000 calls each.

                 localtime     gmtime
    OpenVMS        583           10
    Unix            19.5          9.1

    Fortunately, both operating systems and both compilers are Digitals, so 
    the comparison is, I believe, one of apples and apples.

    Regards, Drew Sanford
    Customer Support Center
    C970227-5970
1184.17Some speculationQUARRY::nethCraig NethThu Apr 03 1997 17:2614
localtime() has to do all of the timezone processing.  Both VMS and DIGITAL
UNIX use the public domain timezone package, but the DIGITAL UNIX version
has been modified to perform better. (in particular, libc keeps some state
that helps it figure out whether or not it needs to search through all
the tables every time tzset is called)  I don't know if those same 
modifications have been applied to the VMS version or not.

In the UNIX version, every time localtime is called a getenv("TZ") call 
ends up being executed.  It could be that this is a faster operation on
UNIX than it is on VMS...




1184.18entered into CRTL internalTAVENG::BORISBoris Gubenko, ISEThu Apr 03 1997 21:1810
  We will investigate this. It may be getenv() or another underlying
  CRTL function that is called by localtime() and is not called by
  gmtime() or, perhaps, VMS missed some performance improvement that
  was done in the UNIX version.

  Could the customer tell us what time zone was used when running the
  comparison?

  Boris
1184.19questionCAIRN::HARRISKevin Harris, dtn 381-2039Fri Apr 04 1997 14:385
I studied this once when I was looking at DEC C compile speed for short programs
on VMS.  I discovered that it needs to bring in a shareable image to look up
something in the timezone database.  I think this is the cause of the long
delay.  Is it slow everytime, or just the first time?
							-Kevin
1184.20More info from customerCSC32::V_HAVERMon Apr 28 1997 17:5816
From customer:

...
Yes, it is slow on every call.  10000 calls in a row take 10 times as long as
1000 calls in a row.  We were in the PST/PDT time zone.  TZ was set to:

"PST8PDT7,M4.1.0,M10.5.0"

When I set the time zone cache to zero (2 is default), localtime became
another order of magnitude or so slower.  Setting the time zone cache to 4 or
higher made no improvement over using the default.
...

Thanks,

Vicky (virtual Drew for today)