> > You would still have to create the timezone singletons -- unless you're
> > suggesting that these would be destroyed when not in use, you would
> > still end up running into the same memory issues once enough timezone
> > objects have been created.
>
> And you wouldn't be able to take advantage of page sharing.


But what if the the singleton object for each timezone was just a flyweight
wrapper with the timezone name and some link to some database file with the
information that could be quickly accessed through XS?

Actually, I have no idea if this is possible, because I don't exactly know
how each timezone object works. From the docs I see each object provides the
following methods:

offset_for_datetime( $dt )
offset_for_local_datetime( $dt )
name
short_name_for_datetime( $dt )
is_floating
is_utc
is_olson
category

Is this ALL each timezone provides, and nothing else? Does anything directly
access timezone object structures in any other way? Because if not, it
should be pretty easy to create an XS wrapper to implement only these
functions, even say by accessing the POSIX zoneinfo database given a
timezone name?

Or am I missing something?

Rob

Reply via email to