ashley at semantic.org
Mon Oct 31 01:43:35 CET 2011
Now on Hackage, version 188.8.131.52 of time includes the rewrite RULES
provided by Liyang HU.
On 25/09/11 03:12, Liyang HU wrote:
> The time package is too slow. :(
> A prime example is diffUTCTime, which invokes utcTimeToPOSIXSeconds,
> which in turn calls realToFrac :: DiffTime -> NominalDiffTime. The
> former of these two types notionally accounts for leap seconds, while
> the latter does not. Both are newtypes around Data.Fixed.Pico.
> Since realToFrac is used in the library only when we know the
> difference is within one day, the two notions coincide, and there is
> no need to account for leap seconds. Indeed it currently (or rather,
> its implementation of "fromRational . toRational") behaves as such.
> I propose we include some rewrite RULES to eliminate the round-trip
> via Rational. For the attached benchmark, I get a ~4x improvement in
> Discussion period: 2 weeks.
More information about the Libraries