Hi Dave, Joshua

Thanks for the responses (and the tip on the Benchmark module - a much 
nicer way of timing it!). If it isn't too much work then I would 
definately think it is worth implementing the Time::Piece code. Some speed 
reduction is acceptable for the added functionality of the DateTime object 
but not this huge factor.

In my case I'm reading in a time stamped series of data, with at least two
values per second (the convenient millisecond timing abilities of DateTime
was the main reason I was trying to use it). 24 hours worth of data 
generates over 150,000 entries that need parsing. Time::Piece manages this 
in a couple of seconds whereas DT takes a couple of minutes, even with the 
parser object...  (Joshua, looking at your email address, you might be 
interested to know this is for a water vapour monitor that is installed on 
the SMA on Mauna Kea).

Anyway, thanks again for your help.

Robin

P.S. One other suggestion, whilst I'm at it. The documentation for the 
strptime parsing contains this line:

       * %N
           Nanoseconds. For other sub-second values use "%[number]N".

It is not at all obvious (to me) what 'number' represents. An example on 
how to use this for milliseconds might help clarify?


--------------------------------

On Thu, 9 Sep 2004, Dave Rolsky wrote:

> On Thu, 9 Sep 2004, Joshua Hoblitt wrote:
> 
> > You can more then double your performance with DateTime::Format::Strptime by
> > instantiating a parser object and reusing it.  You should also keep in mind
> > that Time::Piece doesn't really support leapseconds (it may be able to parse
> > them on some platforms if it's using gmtime(3)...  haven't looked at the
> > source).
> 
> More importantly, Time::Piece->strptime returns a Time::Piece object,
> which is much less useful than a DateTime object.
> 
> Implementing DateTime::Format::StrptimeXS using the code from Time::Piece
> would be relatively trivial.  It'd still be a fair bit slower than
> Time::Piece since constructing a DateTime object is definitely slower than
> constructing a Time::Piece object.
> 
> 
> -dave
> 
> /*===========================
> VegGuide.Org
> Your guide to all that's veg.
> ===========================*/
> 

Reply via email to