[slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. v1.5.11-17-g775c6a5
added by portage for gitosis-gentoo
git-noreply at pixie.qos.ch
Wed Apr 21 17:17:30 CEST 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SLF4J: Simple Logging Facade for Java".
The branch, master has been updated
via 775c6a59df22c048231b8ba31995e4ef79311663 (commit)
via 7be32abc9f7b0eeaa47017c8b7c6800c140222e5 (commit)
via eb4d4944ea655ea47d9491a6e340e98a5bcd995c (commit)
via 09b2354f7f22d732ea4013aaa9efd4839296c007 (commit)
via fd74fb61746d10021f4e33b0c3cd1543a89ffc0c (commit)
via 3c0ab3466b6fa6e915974c72558d64c570734700 (commit)
from 6dd2bd58cffc857d064d0e0ac3017d6aee924bb8 (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=slf4j.git;a=commit;h=775c6a59df22c048231b8ba31995e4ef79311663
http://github.com/ceki/slf4j/commit/775c6a59df22c048231b8ba31995e4ef79311663
commit 775c6a59df22c048231b8ba31995e4ef79311663
Merge: 09b2354 7be32ab
Author: Ceki Gulcu <ceki at qos.ch>
Date: Wed Apr 21 17:16:06 2010 +0200
Merge branch 'bug70'
Conflicts:
slf4j-api/src/test/java/org/slf4j/helpers/MessageFormatterPerfTest.java
diff --cc slf4j-api/src/test/java/org/slf4j/helpers/MessageFormatterPerfTest.java
index 583cc7b,5bfee77..fbec292
--- a/slf4j-api/src/test/java/org/slf4j/helpers/MessageFormatterPerfTest.java
+++ b/slf4j-api/src/test/java/org/slf4j/helpers/MessageFormatterPerfTest.java
@@@ -35,36 -36,42 +36,45 @@@ public class MessageFormatterPerfTest e
BogoPerf.assertDuration(duration, referencePerf, REFERENCE_BIPS);
}
-
- public void testSLF4JPerf_TwoArg() {
- slf4jMessageFormatter_TwoArg(RUN_LENGTH);
- double duration = slf4jMessageFormatter_TwoArg(RUN_LENGTH);
- long referencePerf = 60;
- BogoPerf.assertDuration(duration, referencePerf, REFERENCE_BIPS);
- }
-
- public void testSLF4JPerf_TwoArg() {
- slf4jMessageFormatter_TwoArg(RUN_LENGTH);
- double duration = slf4jMessageFormatter_TwoArg(RUN_LENGTH);
- System.out.println("duration2=" + duration);
- long referencePerf = 60;
- BogoPerf.assertDuration(duration, referencePerf, REFERENCE_BIPS);
- }
-
public double slf4jMessageFormatter_OneArg(long len) {
+ String s = "";
+ s += ""; // keep compiler happy
long start = System.nanoTime();
for (int i = 0; i < len; i++) {
- s = MessageFormatter.format("This is some rather short message {} ", i1);
- final FormattingTuple tp = MessageFormatter.format(
- "This is some rather short message {} ", i1);
++ final FormattingTuple tp = MessageFormatter.format("This is some rather short message {} ", i1);
+ tp.getMessage();
+ tp.getArgArray();
+ tp.getThrowable();
++
++ MessageFormatter.format("This is some rather short message {} ", i1);
}
long end = System.nanoTime();
- return (end - start) / (1000 * 1000.0);
+ return (end - start)/(1000*1000.0);
+ }
++
++ public void testSLF4JPerf_TwoArg() {
++ slf4jMessageFormatter_TwoArg(RUN_LENGTH);
++ double duration = slf4jMessageFormatter_TwoArg(RUN_LENGTH);
++ System.out.println("duration2=" + duration);
++ long referencePerf = 60;
++ BogoPerf.assertDuration(duration, referencePerf, REFERENCE_BIPS);
+ }
public double slf4jMessageFormatter_TwoArg(long len) {
-- String s = "";
-- s += ""; // keep compiler happy
long start = System.nanoTime();
for (int i = 0; i < len; i++) {
- s = MessageFormatter.format("This is some {} short message {} ", i1, i2);
+ final FormattingTuple tp = MessageFormatter.format(
+ "This is some {} short message {} ", i1, i2);
+ tp.getMessage();
+ tp.getArgArray();
+ tp.getThrowable();
}
long end = System.nanoTime();
- return (end - start) / (1000 * 1000.0);
+ return (end - start)/(1000*1000.0);
}
-
+
++
++
public double jdkMessageFormatter(long len) {
String s = "";
s += ""; // keep compiler happy
http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=09b2354f7f22d732ea4013aaa9efd4839296c007
http://github.com/ceki/slf4j/commit/09b2354f7f22d732ea4013aaa9efd4839296c007
commit 09b2354f7f22d732ea4013aaa9efd4839296c007
Author: Ceki Gulcu <ceki at qos.ch>
Date: Wed Apr 21 16:28:31 2010 +0200
added a two arg test
diff --git a/slf4j-api/src/test/java/org/slf4j/helpers/MessageFormatterPerfTest.java b/slf4j-api/src/test/java/org/slf4j/helpers/MessageFormatterPerfTest.java
index 3c6f236..583cc7b 100644
--- a/slf4j-api/src/test/java/org/slf4j/helpers/MessageFormatterPerfTest.java
+++ b/slf4j-api/src/test/java/org/slf4j/helpers/MessageFormatterPerfTest.java
@@ -7,9 +7,11 @@ import junit.framework.TestCase;
public class MessageFormatterPerfTest extends TestCase {
Integer i1 = new Integer(1);
+ Integer i2 = new Integer(2);
static long RUN_LENGTH = 100000;
- static long REFERENCE_BIPS = 9000;
-
+ //
+ static long REFERENCE_BIPS = 48416;
+
public MessageFormatterPerfTest(String name) {
super(name);
}
@@ -23,36 +25,56 @@ public class MessageFormatterPerfTest extends TestCase {
public void XtestJDKFormatterPerf() {
jdkMessageFormatter(RUN_LENGTH);
double duration = jdkMessageFormatter(RUN_LENGTH);
- System.out.println("jdk duration = "+duration+" nanos");
+ System.out.println("jdk duration = " + duration + " nanos");
+ }
+
+ public void testSLF4JPerf_OneArg() {
+ slf4jMessageFormatter_OneArg(RUN_LENGTH);
+ double duration = slf4jMessageFormatter_OneArg(RUN_LENGTH);
+ long referencePerf = 36;
+ BogoPerf.assertDuration(duration, referencePerf, REFERENCE_BIPS);
}
+
- public void testSLF4JPerf() {
- slf4jMessageFormatter(RUN_LENGTH);
- double duration = slf4jMessageFormatter(RUN_LENGTH);
- long referencePerf = 140;
+ public void testSLF4JPerf_TwoArg() {
+ slf4jMessageFormatter_TwoArg(RUN_LENGTH);
+ double duration = slf4jMessageFormatter_TwoArg(RUN_LENGTH);
+ long referencePerf = 60;
BogoPerf.assertDuration(duration, referencePerf, REFERENCE_BIPS);
}
- public double slf4jMessageFormatter(long len) {
- String s = "";
+ public double slf4jMessageFormatter_OneArg(long len) {
+ String s = "";
s += ""; // keep compiler happy
- long start = System.currentTimeMillis();
+ long start = System.nanoTime();
for (int i = 0; i < len; i++) {
s = MessageFormatter.format("This is some rather short message {} ", i1);
}
- long end = System.currentTimeMillis();
- return (1.0*end - start);
- }
+ long end = System.nanoTime();
+ return (end - start)/(1000*1000.0);
+ }
+
+ public double slf4jMessageFormatter_TwoArg(long len) {
+ String s = "";
+ s += ""; // keep compiler happy
+ long start = System.nanoTime();
+ for (int i = 0; i < len; i++) {
+ s = MessageFormatter.format("This is some {} short message {} ", i1, i2);
+ }
+ long end = System.nanoTime();
+ return (end - start)/(1000*1000.0);
+ }
+
public double jdkMessageFormatter(long len) {
- String s = "";
+ String s = "";
s += ""; // keep compiler happy
long start = System.currentTimeMillis();
- Object[] oa = new Object[] {i1};
+ Object[] oa = new Object[] { i1 };
for (int i = 0; i < len; i++) {
s = MessageFormat.format("This is some rather short message {0}", oa);
}
long end = System.currentTimeMillis();
- return (1.0*end - start);
+ return (1.0 * end - start);
}
}
-----------------------------------------------------------------------
Summary of changes:
.../java/org/slf4j/helpers/FormattingTuple.java | 74 +++
.../java/org/slf4j/helpers/MessageFormatter.java | 51 ++-
.../slf4j/helpers/MessageFormatterPerfTest.java | 70 ++-
.../org/slf4j/helpers/MessageFormatterTest.java | 150 +++---
.../src/main/java/org/slf4j/ext/LoggerWrapper.java | 99 +++--
slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java | 12 +-
.../org/slf4j/instrumentation/LogTransformer.java | 535 ++++++++++----------
.../main/java/org/slf4j/impl/JCLLoggerAdapter.java | 62 ++--
.../java/org/slf4j/impl/JDK14LoggerAdapter.java | 61 ++--
.../java/org/slf4j/impl/Log4jLoggerAdapter.java | 64 ++--
.../src/main/java/org/slf4j/impl/SimpleLogger.java | 84 ++--
11 files changed, 723 insertions(+), 539 deletions(-)
create mode 100644 slf4j-api/src/main/java/org/slf4j/helpers/FormattingTuple.java
hooks/post-receive
--
SLF4J: Simple Logging Facade for Java
More information about the slf4j-dev
mailing list