On Mar 17, 2:11 am, funny_falcon <[email protected]> wrote:
> It is well known that date parsing is slow.
>
> ActiveRecord tries to deal with it by speadup common db 
> formathttps://github.com/rails/rails/blob/master/activerecord/lib/active_re...
> (but it doesn't handle timezone)
>
> Sequel suffers from date parsing slowness when it is not provided by
> adaptors.
> Currently such adaptors are `postgres`, `sqlite` and `mysql` (not
> `mysql2` I believe).
> (one could use `sequel_pg` to speedup postgres adapter).
>
> I propose to include speedup of timestamp parsing into sequel core or
> into sequel extension.
> It really helps with sqlite3 and postgres, not tested with mysql.
>
> Simple monkey patch against sequel with benchmark is 
> herehttps://gist.github.com/871634
> Or it could just override Time.parse as herehttps://gist.github.com/874002
>
> What do you think about?

Just a heads up, funny_falcon also sent me a patch to home_run
(https://github.com/jeremyevans/home_run/pull/24) that should speed up
timestamptz formated timestamps and makes it much closer in speed to
this patch.  Assuming no problems during testing, this should go in
shortly.

Personally, I don't think custom parsers like this make sense for a
database library, so unless people here have strong feelings that this
should go in, I'm going to recommend just overriding Time.parse.  I
think if you took the home_run parser with funny_falcon's patch and
changed it so that it created Time values directly (currently it
creates an intermediate hash, as that is how the stdlib works), it
would probably be even faster than this patch.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to