Marvin Humphrey <[email protected]> writes:
> On Thu, Oct 25, 2012 at 1:35 AM, Dag Lem <[email protected]> wrote:
> > Even though ClusterSearcher is implemented in Perl, I don't see that
> > the C function top_docs would be calling back into Perl space here,
> > and thus I still don't understand the (big) discrepancy.
>
> As a matter of fact, we **are** calling back into Perl-space. :)
I'm sorry, I should have said *SearchServer* (which I did earlier,
some wires must have crossed inside my head) :-/ It's top_docs() in
the *server* that's gobbling up all the cycles, according to
Devel::DProf/dprofpp - just have a look at the profiling info I sent
earlier. The baffling issue is still:
* Lucy::Search::IndexSearcher::top_docs (used by SearchServer) is
about twice as slow Lucy::Search::Searcher::hits (used by
IndexSearcher).
I still don't understand that one...
I do appreciate your explanation on method dispatching in Lucy, though :)
[...]
> I gave it a quick look-see, and your code looks like an accurate port --
> kudos!
>
> What I was suggesting was something slightly different though:
>
> if ($top_docs) {
> my $top_docs = $searcher->top_docs(query => $real_query,
> num_wanted => $wanted);
> }
I see; that would have been better, but since I ran profiling I got a
measure on top_docs() anyway, and it was slightly faster than hits().
So how can top_docs() be twice as *slow* as hits() when top_docs() is
called from SearchServer?
--
Best regards,
Dag Lem