Thanks, Pat. I think a class variable will suit my app.
On Jul 29, 3:48 am, Pat Allan <[email protected]> wrote:
> Hi Jeffrey
>
> Well spotted - and I think it'd be great to have class_from_crc as a
> class method. The issue with class variables, though, is that they're
> not threadsafe (which is something that TS needs to improve on,
> generally), so some thought will need to go into fixing it properly.
> Suggestions are welcome - threadsafe code is obviously not my strong
> point.
>
> --
> Pat
>
> On 28/07/2009, at 9:58 PM, Jeffrey Chupp wrote:
>
>
>
>
>
> > I have a project with roughly 60 models being indexed. I've updated
> > to the latest version of TS and I'm getting a full second of time
> > absorbed in the class_from_crc method per search. Obviously the
> > number of models is high, but I feel like I'm doing something wrong
> > and that this should be cached on the class level instead of just on
> > the instance level. It seems that even with significantly fewer
> > models, that's still a performance hit to calculate the crcs each
> > time.
>
> > Changing @models_by_crc to @@models_by_crc saves the expense (after
> > the first search), but if that is meant to be an instance variable for
> > a good reason, then that would break it.
>
> > Is there any danger in making this a class variable? Am I doing
> > something wrong? I've tried ThinkingSphinx::Search.search and
> > ThinkingSphinx.search and both still do the calculations every time...
>
> > ( Is this perhaps the result of moving the class_from_crc to an
> > instance method when it was a class method in the old version I was
> > using? )
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" 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/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---