Skip to content

Instantly share code, notes, and snippets.

View Crypt.java
package test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
@ecki
ecki / DLog.java
Created Aug 19, 2015
Testing @DLogBot
View DLog.java
package test;
import java.math.BigInteger;
public class DLog
{
// testing @DLogBot http://crypto.2015.rump.cr.yp.to/e7803fa1f87ce2a18dbbbbcffc8d5695.pdf
public static void main(String[] args)
{
BigInteger apache = b("9fdb8b8a004544f0045f1737d0ba2e0b274cdf1a9f588218fb435316a16e374171fd19d8d8f37c39bf863fd60e3e300680a3030c6e4c3757d08f70e6aa871033");
@ecki
ecki / AbandonTest.java
Last active Aug 29, 2015
commons-dbcp abandon connection killing
View AbandonTest.java
package net.eckenfels.test.dbcp;
import java.io.PrintWriter;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Locale;
import java.util.TimeZone;
@ecki
ecki / ToString.java
Last active Jul 20, 2017
JMH int to String Benchmark
View ToString.java
// class name and method names are not Java convention but readable
package net.eckenfels.jmhtest;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
View HashMapCollision.java
package net.eckenfels.jmhtest.hash;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
@ecki
ecki / HashBenchmark.java
Created Dec 4, 2014
JMH Test Crypt Hash Performance
View HashBenchmark.java
package net.eckenfels.test.jmh;
import java.nio.ByteBuffer;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeUnit;
import javax.crypto.KeyGenerator;
@ecki
ecki / MyBenchmark.java
Last active Aug 29, 2015
JMH Test for apache commons pool-277 (atomic max statistic)
View MyBenchmark.java
package net.eckenfels.jmh.testmax;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Scope;
@ecki
ecki / re-find.diff
Created Aug 22, 2014
JMH Patch for RE pattern matching
View re-find.diff
diff -r 0d74d2f85299 jmh-core/src/main/java/org/openjdk/jmh/runner/BenchmarkList.java
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/BenchmarkList.java Wed Aug 20 16:23:00 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/BenchmarkList.java Fri Aug 22 02:36:54 2014 +0200
@@ -85,7 +85,7 @@
}
/**
- * Gets all the micro benchmarks that matches the given regexp, sorted
+ * Gets all the micro benchmarks that matches the given regexp, sorted.
*
@ecki
ecki / StringConcat.java
Created Aug 10, 2014
JMH Test to compare single-shot performance if StringBuffer and +=
View StringConcat.java
package net.eckenfels.jmh;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.*;
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 5, time = 4, timeUnit = TimeUnit.SECONDS)
View logstashechocrash
C:\logtest>java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
C:\logtest>type inout.cfg
input {
stdin { }
}
You can’t perform that action at this time.