Hi Christian

I also just used .all directly and the same results apply, i.e.

AR:
Client.all

SEQUEL:
SIA::SIAModels::Client.all

Cheers,
Ciaran

On Nov 22, 3:06 pm, Ciaran Archer <[email protected]> wrote:
> Hi Christian
>
> Here is the corresponding AR code:https://gist.github.com/1385852
>
> I am dealing with a 72 record table, so that 'clientid > 0' is going
> to bring back all rows, but that is the same for AR and Sequel.
>
> In the Sequel test, I can see from debug that the query is taking a
> very small amount of time, typically around 0.001000s. Yet after all
> output the benchmark is reading 0.29800009727478s.
>
> AR on the other hand says the SQL was done in 0.022s and after all
> output I am seeing a figure of say 0.0409998893737793.
>
> Thanks,
> Ciaran
>
> On Nov 22, 2:20 pm, Christian MICHON <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > On Tue, Nov 22, 2011 at 2:52 PM, Ciaran Archer <[email protected]> 
> > wrote:
> > > Hi there
>
> > > We've been evaluating the use of Sequel with SQL Server, and as poart
> > > of this we've been benchmarking Sequel against AR.
>
> > > We're using JRuby, and Torquebox as our application server for all
> > > tests. We are using Sinatra as our web framework and Apache Bench to
> > > run the tests. A SQL Server 2008 R2 instance is being used for the
> > > tests.
>
> > > Our benchmark test is very simple, return all rows in a table and
> > > print them to the standard output. The test table has 72 rows.
>
> > > AR BENCHMARK RESULTS
>
> > > Requests per second:    182.08 [#/sec] (mean)
> > > Time per request:       54.922 [ms] (mean)
>
> > > SEQUEL BENCHMARK RESULTS
>
> > > Requests per second:    8.72 [#/sec] (mean)
> > > Time per request:       1146.993 [ms] (mean)
>
> > > I've extracted the relevant Sequel code, 
> > > here:https://gist.github.com/1385695
>
> > I would say the following line must be expensive:
> > dataset.filter("clientid > 0")
>
> > Why didn't you use all directly ?
>
> > > I am trying to understand why Sequel seems to be doing so poorly and
> > > I'm hoping someone can tell me where I might be introducing an issue,
> > > or where I might be able to improve things.
>
> > Where is the equivalent AR code ?
>
> > > Apologies in advance if the code is not super, I've only been using
> > > Ruby a few months :)
>
> > Well you already make use of modules...
>
> > --
> > Christian

-- 
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