https://bz.apache.org/bugzilla/show_bug.cgi?id=61875
--- Comment #2 from Jeremy Boynes <jboy...@apache.org> ---
I applied the patch and made the ForEachTag tests work and am seeing the same
performance problem we had before.

With the current implementation the testIterationPerformance test completes
200K iterations in 1250ms. 

With the patched version, this test did not complete within a reasonable time.
When I lower the iteration count from 200K to 20K it completed in 46000ms. This
looks like the same n^2 behaviour we saw before the fix for 27717.

This is the test I ran with the modifications to work with JAXP:

    @Ignore
    @Test
    public void testIterationPerformance() throws Exception {
        // create a large document
        test = newBenchmarkDocument(20000);

        XPathExpression dot =
XPathFactory.newInstance().newXPath().compile(".");
        expect(pageContext.findAttribute("doc")).andStubReturn(test);
        tag.setSelect("$doc/root/a");
        replay(pageContext);
        long time = -System.nanoTime();
        String result = null;
        if (tag.doStartTag() == IterationTag.EVAL_BODY_INCLUDE) {
            do {
                result = dot.evaluate(tag.getCurrent());
            } while (tag.doAfterBody() == IterationTag.EVAL_BODY_AGAIN);
            tag.doFinally();
        }
        time += System.nanoTime();
        System.err.println("time = " + time / 1000000 + "ms.");
        assertEquals("199999", result);
    }

time = 46673ms.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to