RE: Time zones are driving me CRAZY [partially SOLVED]
RE: Time zones are driving me CRAZY [partially SOLVED]
- Subject: RE: Time zones are driving me CRAZY [partially SOLVED]
- From: "Pierre Bernard" <email@hidden>
- Date: Fri, 14 Nov 2003 15:14:49 +0100
- Thread-topic: JavaClient performance vs. JDK 1.4.1
Hi!
The culprid for the performance problems is indeed a private class named _NSGregorianCalendar which references a time zone by the name of UTC. Unfortunately, the correct way to refer to this time zone is by the name of "etc/UTC".
This name is passed to a method on the TimeZone class to retrieve the actual time zone information. When called, this method lazily retieves the time zone information from a set of files. Sun, in their remarkably infinite wisdom, chose not to have this throw when the appropriate file is not found so you'll never know you got the name wrong. Instead it returns a dummy GMT timezone. Upon the next call the file system is again checked for the missing file. These countless IO operations cause a major performance hit.
I have yet to determine if this bug is also responsible for the erratic behavior I am seeing with timestamps. It most likely is - due to the fact that UTC and GMT are not equal, yet where Apple expects to get UTC, Sun merrily hands over GMT.
Thus, if you see performance problems with timestamp related operations - or just want to considerably speed up your application - you know what to do. :-)
I'll file a bug report shortly. Expecting at least a medal for this. :-)
Pierre
--
Got a hang for movies?
http://homepage.mac.com/I_love_my/movies.html
-----Original Message-----
From: Pierre Bernard
Sent: Thursday, November 13, 2003 6:02 PM
To: Pierre Bernard; email@hidden
Subject: RE: Time zones are driving me CRAZY
Hi,
Seems like I got a lead: something inside Foundation must be using a timezone named UTC, which Java does not seem to know.
Wish me luck
Pierre
--
Got a hang for movies?
http://homepage.mac.com/I_love_my/movies.html
-----Original Message-----
From: Pierre Bernard
Sent: Thursday, November 13, 2003 3:27 PM
To: Nick Pilch; email@hidden
Subject: Time zones are driving me CRAZY
Hi!
Since updating to WO 5.2.2 on JDK 1.4.1_05-b01 on Windows & Solaris, we are seeing an impressive number of various and most mysterious prombles with date / timestamp related operations.
1. I recently sent a message to this mailing list asking about other developer's experience with the performance of JavaClient after the update. We are experiencing a very noticeable slowdown. We since have trace down the performance bottleneck to a private Sun class named ZoneInfoFile. Indeed, the components most affected by the sudden drop in speed display lots of timestamps. ZoneInfoFile kicks in for each timestamp that is paresed or formatted. Our current working hypothesis is that that class does attempt lazy initialization but fails to read the timezone file. It thus goes to do a filesystem access each time a timestamp is used in some way.
2. As I recently mentionned here, I am seeing problems with date string parsing when I have set the default time zone to an instance of NSTimeZone. In some frequent situations working with dates, especially parsing, leads to wrong results. I can't yet determine if there is a pattern to this behavior. The workaround here is to use a standard TimeZone.
3. Well, with a standard TimeZone date string parsing seems fine (albeit slow). That is until I attempt to parse a date that is way in the past. Then the offset seems to be wrong. Parsing and the formatting a date does not lead back to the original string. What's odd is that the date in time that acts as border between dates parsed correctly and dates parsed incorrectly does not seem to be consistent. On one setup we observed it to be in January 1917, another test points to June 1916 and yet another one parses dates fine back until January 1905.
I suspect ZoneInfoFile to be the root cause of the trouble, but yet have a lot of chasing down to do. What's odd is that I can't find mention of similar bugs in Sun's bug database.
Pierre.
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.