Your mail is quite confusing.
After reformatting there are a few things where I think that you eighter use an outdated version or are having problems with your profiler.

loadClass is always called 54 times... but with 4 commented lines it takes 70ms less to load ? With the same ammount of lines ?
_query is always called 129 times... 111ms less...
_loadTranslationData is called once... 30ms less...
and so on...

The data is completly wrong or wrong measured.

loadClass is not part of Zend_Date and loads the complete file... so why should it take so much lesser time when the file has changed in 4 lines. _loadTranslationData is part of Zend_Locale and completly independend from Zend_Date... it can not take lesser time... getStationsFromResult is not even a method from ZF... and so on.

What I want to say is that your measurement is not representative. It seems like you've run the tests one after the other with turned on cache. Also to mention is, that when you use unix timestamps which is equal to integer values, the mentioned function is not called.

When I comment out the line 199 and 200 the class is corrupted because a if clause is broken.

Sorry, but I can not reproduce your problem. Maybe you could update to the latest trunk, so we both speak from the same code.

Greetings
Thomas Weidner, I18N Team Leader
http://www.thomasweidner.com

----- Original Message ----- From: "Davide Mendolia" <[EMAIL PROTECTED]>
To: "Thomas Weidner" <[EMAIL PROTECTED]>
Sent: Friday, March 28, 2008 3:23 PM
Subject: Re: [fw-i18n] setTimezone and getTimezoneFromString


Yes i use the format from mysql without timezone information in it.

Following the result of my profiling with zend studio on a page of my
application :

  Function Calls Count Average Own Time Own Time(s) Others Time(s) Total
time(s)   loadClass  54 0,003734 0,201624 0,290387 0,492011   setTimezone
211 0,000859 0,181282 0,003112 0,184394   _query  129 0,000766 0,098753
0,001724 0,100477   get  400 0,000122 0,048777 0,050151 0,098928
getStationsFromResult  1 0,045352 0,045352 0,039419 0,084771
_loadTranslationData 1 0,043044 0,043044 0,073015 0,116059 isReadable 29
0,001202 0,034853 0,000000 0,034853   isLocale  806 0,000042 0,033534
0,028038 0,061572   _calculate  63 0,000488 0,030753 0,291324 0,322077
_parseDate  41 0,000696 0,028554 0,135469 0,164023

The same profiling after commenting line 199, 200, 1211, 1212 in Zend_Date :

  Function Calls Count Average Own Time Own Time(s) Others Time(s) Total
time(s)   loadClass  54 0,003299 0,178169 0,251378 0,429547   _query  129
0,000583 0,075260 0,001285 0,076545   _loadTranslationData  1 0,035866
0,035866 0,050433 0,086299   getStationsFromResult  1 0,033911 0,033911
0,024751 0,058662 isReadable 29 0,001083 0,031419 0,000000 0,031419 get
400 0,000078 0,031011 0,033435 0,064446   __construct  2 0,011940 0,023879
0,000000 0,023879   _loadClass  12 0,001880 0,022560 0,045609 0,068169
_calculate 63 0,000343 0,021589 0,191601 0,213190 isLocale 806 0,000025
0,019920 0,017211 0,037131

On Wed, Mar 26, 2008 at 8:05 PM, Thomas Weidner <[EMAIL PROTECTED]>
wrote:

Where do you see a performance problem ???
I've run tests on my development laptop with a average execution time for
the related function of 0.3 milliseconds without using any cache.

Are you using historical timestamps ? This could lead to performance
issues.

Greetings
Thomas Weidner, I18N Team Leader
http://www.thomasweidner.com

----- Original Message -----
From: "Davide Mendolia" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2008 6:57 PM
Subject: [fw-i18n] setTimezone and getTimezoneFromString


> Hi,
>
> How it's possible to skip or minimize the impact of performance of the
> following lines, when you instantiate a date with a format without
> timezone
> in it ?
>
> Zend_Date::__construct()
>
> 198:        // try to get timezone from date-string
> 199:        $zone = $this->getTimezoneFromString($date);
> 200:        $this->setTimezone($zone);
>
> And specialy the call to DateObject::setTimezone()
> 1016:     if ([EMAIL PROTECTED]($zone)) {
> ----------------------------------------------------------
> Example of Zend_Date object:
> new Zend_Date($row['stage_time_start'], Zend_Date::TIMESTAMP)
> Value of $row['stage_time_start']: UNIX_TIMESTAMP(stage_time_start) as
> stage_time_start(in a sql query.)
>
> Thanks
> --
> Davide Mendolia
>




Reply via email to