https://bz.apache.org/bugzilla/show_bug.cgi?id=68596

--- Comment #10 from Jeanclaude <[email protected]> ---
Comment on attachment 39573
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39573
Support class for the speed test

>package com.engebretson;
>
>public abstract class BaseSpeedTest {
>    private final int numTests;
>    private final int numTestIterations;
>
>    public BaseSpeedTest() {
>        numTests = 20;
>        numTestIterations = 100000;
>    }
>
>    public BaseSpeedTest(int numTests, int numTestIterations) {
>        this.numTestIterations = numTestIterations;
>        this.numTests = numTests;
>    }
>
>    protected void runTests() {
>        // warmup
>        for (int i = 0; i < numTestIterations; i++) {
>            runOldTest();
>            runNewTest();
>        }
>
>        for (int i = 0; i < numTests; i++) {
>            System.gc();
>            long startOld = System.currentTimeMillis();
>            for (int j = 0; j < numTestIterations; j++) {
>                runOldTest();
>            }
>            System.out.println("Done with old in " + 
> (System.currentTimeMillis() - startOld));
>            postOldTest();
>        }
>
>        for (int i = 0; i < numTests; i++) {
>            System.gc();
>            long startNew = System.currentTimeMillis();
>            for (int j = 0; j < numTestIterations; j++) {
>                runNewTest();
>            }
>            System.out.println("Done with new in " + 
> (System.currentTimeMillis() - startNew));
>            postNewTest();
>        }
>    }
>
>    protected void postNewTest() {
>    }
>
>    protected void postOldTest() {
>    }
>
>    protected abstract void runOldTest();
>
>    protected abstract void runNewTest();
>
>}

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to