[logback-dev] branch, master, updated. e5c863712b04faf94fab7678f01081f424e03893
added by portage for gitosis-gentoo
git-noreply at pixie.qos.ch
Sun Nov 8 19:20:26 CET 2009
The branch, master has been updated
via e5c863712b04faf94fab7678f01081f424e03893 (commit)
from 0ec1b9eeed802b86dbc791654eeefb59ec327e25 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=e5c863712b04faf94fab7678f01081f424e03893
http://github.com/ceki/logback/commit/e5c863712b04faf94fab7678f01081f424e03893
commit e5c863712b04faf94fab7678f01081f424e03893
Author: Ceki Gulcu <ceki at qos.ch>
Date: Sun Nov 8 19:15:58 2009 +0100
- added warm up runs to failing LoggingEventSerializationPerfTest
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/spi/LoggingEventSerializationPerfTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/spi/LoggingEventSerializationPerfTest.java
index 862fc18..fe25a2f 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/spi/LoggingEventSerializationPerfTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/spi/LoggingEventSerializationPerfTest.java
@@ -27,7 +27,7 @@ import org.slf4j.helpers.BogoPerf;
import ch.qos.logback.classic.net.NOPOutputStream;
import ch.qos.logback.classic.net.testObjectBuilders.Builder;
import ch.qos.logback.classic.net.testObjectBuilders.LoggingEventWithParametersBuilder;
-import ch.qos.logback.classic.net.testObjectBuilders.TrivialLoggingEventBuilder;
+import ch.qos.logback.classic.net.testObjectBuilders.TrivialLoggingEventBuilder;
import ch.qos.logback.core.CoreConstants;
import ch.qos.logback.core.testUtil.Env;
@@ -89,18 +89,17 @@ public class LoggingEventSerializationPerfTest {
}
TrivialLoggingEventBuilder builder = new TrivialLoggingEventBuilder();
- doLoop(builder, LOOP_LEN);
- noos.reset();
- double avg = doLoop(builder, LOOP_LEN); noos.reset();
- avg += doLoop(builder, LOOP_LEN); noos.reset();
- avg += doLoop(builder, LOOP_LEN);
-
- avg = avg/3;
+ for (int i = 0; i < 3; i++) {
+ doLoop(builder, LOOP_LEN);
+ noos.reset();
+ }
+ double rt = doLoop(builder, LOOP_LEN);
+ System.out
+ .println("avetage time per logging event " + rt + " nanoseconds");
- System.out.println("avetage time per logging event "+avg+" nanoseconds");
-
- long averageSize = (long) (noos.size()/(LOOP_LEN));
- System.out.println("noos size "+noos.size()+ " average size="+averageSize);
+ long averageSize = (long) (noos.size() / (LOOP_LEN));
+ System.out.println("noos size " + noos.size() + " average size="
+ + averageSize);
double averageSizeLimit = 60;
assertTrue("average size " + averageSize + " should be less than "
@@ -108,10 +107,9 @@ public class LoggingEventSerializationPerfTest {
// the reference was computed on Orion (Ceki's computer)
long referencePerf = 5000;
- BogoPerf.assertDuration(avg, referencePerf, CoreConstants.REFERENCE_BIPS);
+ BogoPerf.assertDuration(rt, referencePerf, CoreConstants.REFERENCE_BIPS);
}
-
-
+
@Test
public void testPerformanceWithParameters() {
if (Env.isLinux()) {
@@ -119,19 +117,23 @@ public class LoggingEventSerializationPerfTest {
}
LoggingEventWithParametersBuilder builder = new LoggingEventWithParametersBuilder();
- doLoop(builder, LOOP_LEN);
- noos.reset();
- double avg = doLoop(builder, LOOP_LEN);
- long averageSize = (long) (noos.size()/(LOOP_LEN));
+ // warm up
+ for (int i = 0; i < 3; i++) {
+ doLoop(builder, LOOP_LEN);
+ noos.reset();
+ }
+ double rt = doLoop(builder, LOOP_LEN);
+ long averageSize = (long) (noos.size() / (LOOP_LEN));
+
+ System.out.println("noos size " + noos.size() + " average size="
+ + averageSize);
- System.out.println("noos size "+noos.size()+ " average size="+averageSize);
-
double averageSizeLimit = 160;
assertTrue("averageSize " + averageSize + " should be less than "
+ averageSizeLimit, averageSizeLimit > averageSize);
// the reference was computed on Orion (Ceki's computer)
long referencePerf = 7000;
- BogoPerf.assertDuration(avg, referencePerf, CoreConstants.REFERENCE_BIPS);
+ BogoPerf.assertDuration(rt, referencePerf, CoreConstants.REFERENCE_BIPS);
}
}
-----------------------------------------------------------------------
Summary of changes:
.../spi/LoggingEventSerializationPerfTest.java | 46 ++++++++++---------
1 files changed, 24 insertions(+), 22 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
More information about the logback-dev
mailing list