Hi--

The developers on our team recently started complaining about the
speed of server responses and launching script/console in development
mode. Some quick work with "git bisect" indicated it was my commit
that switched us from acts_as_solr to thinking_sphinx.

Some benchmarking shows that launching script/console goes from around
6.2 seconds to 9.8 seconds when the TS plugin is installed and the
define_index calls in two models are present. Commenting out the
define_index calls has no effect; it's the mere presence of the plugin
that causes the slowdown.

When running script/server, the slowdown happens _before_ Rails is
invoked, so the time doesn't show up in the "Completed in 0.01884 (53
reqs/sec)" benchmark lines. Our site makes a number of Ajax calls, so
the price per page load is fairly high.

This indicates to me that TS is doing something on every request that
is slowing things down. From a brief perusal of the two init.rb files,
I'm guessing that TS is re-scanning the models directory, which is
rather large for our site, and reloading all the models.

Since TS is a plugin, I don't expect it to pick up changes without
restarting the server, so what's the best way to avoid this
performance hit?

I've never written a plugin, so I'm unfamiliar with the ins and outs
of load-time and dispatch-time hooks.

This isn't a concern in production mode, I think, but boy, do we
developers complain when things slow down. :-)

I appreciate any help. Thanks,
Lee

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

Reply via email to