I'm preparing a presentation on Sequel, and I wanted to show some 
benchmarks comparing Sequel performance to Active Record.

First off, to equalize the fact that Active Record typecasts column values 
on-the-fly when the column reader is called, in my benchmark I'm calling 
all column readers after fetching the records from the database.

However, I noticed that Active Record's PostgreSQL & SQLite adapters both 
seem to use the underlying client gem (pg & sqlite3) to convert timestamps, 
while Sequel converts timestamps itself via 
Database#to_application_timestamp. On CRuby, Time.parse is quite slow, and 
it usually dominates my benchmarks. For Postgres adapter everything is fine 
when I use sequel_pg, though.

I'm curious whether there is a possibility for Sequel's PostgreSQL & SQLite 
adapters to let the pg/sqlite3 gems to convert the timestamps into Time 
objects. I know that at least replicating the timezone handling could be 
tricky. But this could improve performance significantly when fetching 
records with lots of timestamps. Since most Ruby developers prefer 
Postgres, it would also mean that Sequel's postgres adapter would be faster 
out-of-the-box (for folks that haven't yet discovered sequel_pg).

Kind regards,
Janko

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/e274102c-f15b-4e13-9baf-c58c2e006678n%40googlegroups.com.

Reply via email to