97jaz / gregor

Date and time library for Racket
45 stars 10 forks source link

~t format compile #45

Open samdphillips opened 4 years ago

samdphillips commented 4 years ago

These patches improve the performance of the ~t time object formatter. Basically instead of recomputing a string conversion function for the format string each time ~t is used we memoize the function based on the format string and locale. The 'compiled' functions also close over the static results of some CLDR lookups instead of performing them every time.

Some benchmark comparisons at https://gist.github.com/samdphillips/395fa1707ba12850e17ed9625e812990

97jaz commented 4 years ago

@samdphillips Just want to leave a note and let you know that I'm aware of your patch, but I haven't yet gone over the whole thing. I will, though.