On Dec 29, 12:16 pm, Olek Poplavsky <[email protected]> wrote:
> After much of investigation it all boiled down for the fact that for
> one reason or another Sequel is more wasteful with memory, comparing
> to my old ActiveRecord code. Essentially, my new code is generating
> DOUBLE of wasted memory that needs to be garbage collected, and my
> garbage collection times are starting to become large then my 'useful
> computing' times. For 500 executions of my old code about 350MB of
> memory would be 'spent and collected', and for new code that number
> went up to 600MB, number of allocations themselves went from 7M to 9M.

The only reason I can think of where Sequel would be more wasteful
than ActiveRecord is the fact that it typecasts on retrieval, instead
of typecasting on access.  This is necessitated by Sequel's design and
cannot be changed.  However, that shouldn't matter unless you are
retrieving columns that you are not using (especially date/timestamp
columns, which are more expensive to convert).  Are you sure you are
using all of the columns you are retrieving?  If you aren't using the
columns, remove them from the query.  If you are using them, but only
in rare cases, you can cast them to string in the query, and then
convert them manually in your code.

You didn't mention what adapter and database you are using, or post a
link to any of the code, so it's hard to make concrete
recommendations.  If you provide more information, I'll try to give
tips on optimization.

I'll certainly consider optimizations to Sequel that don't have
negative effects on the rest of the code. :)

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