lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <markrmil...@gmail.com>
Subject Re: unit test speed for TestCustomScoreQuery
Date Thu, 29 Oct 2009 19:12:45 GMT
+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