lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: unit test speed for TestCustomScoreQuery
Date Fri, 30 Oct 2009 00:48:32 GMT
I *finally* looked at the Jira and lo! you specifically identified the
check method.... Someday I'll learn to look first, *then* explore.
Siiigghhh.

Anyway, looking at things a bit more, I'm more confident that
TestCustomScoreQuery wouldn't lose anything by moving the
query check outside of the loop. The queries don't change and
we're not re-querying....

TestBooleanShouldMatch is trickier. It produces 1,000 queries
that have widely varying forms. I don't see a clean way to test
one of each "form". We could decide that, say, the first 50
were enough. Or we shouldn't be running check on randomly-
generated queries. Or if we find a query that's actually a bug
we should test for it explicitly. Or... But I'm not comfortable
changing the check in the random test without some
consensus.

I'll give folks a chance to chime in between now and Monday
and generate a patch for one or both depending on the response.

Erick

On Thu, Oct 29, 2009 at 3:12 PM, Mark Miller <markrmiller@gmail.com> wrote:

> +1 - I made a similar observation a while back and started an issue to
> address Junit test speeds:
>
> https://issues.apache.org/jira/browse/LUCENE-1844
>
> Erick Erickson wrote:
> > OK, I'm actually getting of my duff and trying to do something. And
> > I'm off today feeling ill, so I have a bit of time. So the rational
> > place to start is to get all the code and run the unit tests, and I've
> > even got them running in IntelliJ as well as the ant task. Will
> > wonders never cease.
> >
> > The unit tests in TestCustomScoreQuery take on the order of 80 seconds
> > on my machine. Before I go off the deep end I wanted to run what I've
> > found past y'all to see if it makes sense.
> >
> > Virtually all the time is taken up in the method logResult on the call
> > to QueryUtils.check(q, s). But the logResult method is called from
> > verifyResults method in a loop like:
> >
> > for (Iterator it = h1.keySet().iterator(); it.hasNext();) {
> >       call logResult for 5 different queries.
> > }
> > But the queries don't change that I can see...
> >
> > Why couldn't we just call QueryUtils.check once for each of the 5
> > queries outside the for loop? Doing so reduces the time it takes for
> > the test from ~80 seconds to 9 seconds.
> >
> > If there're no objections, I'll make a patch. Which folks will
> > probably have to be patient with me since it'll be the first one I've
> > produced for this project.....
> >
> > While I'm at it, what are we thinking about using JUnit4? Looking
> > *briefly* at the code, this actually seems like it'd be difficult.
> > We'd have to deal with the LuceneTestCase superclass...
> >
> > Best
> > Erick
>
>
> --
> - Mark
>
> http://www.lucidimagination.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

Mime
View raw message