This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package chronicle.demo; | |
import net.openhft.chronicle.bytes.Bytes; | |
import net.openhft.chronicle.wire.BinaryWire; | |
import net.openhft.chronicle.wire.TextWire; | |
/** | |
* Created by daniel on 09/10/2015. | |
*/ | |
public class WireDeserialiseIntoObjectDemo { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package chronicle.demo; | |
import net.openhft.chronicle.bytes.IORuntimeException; | |
import net.openhft.chronicle.wire.Marshallable; | |
import net.openhft.chronicle.wire.WireIn; | |
import net.openhft.chronicle.wire.WireOut; | |
/** | |
* Created by daniel on 08/10/2015. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package chronicle.demo; | |
import net.openhft.chronicle.bytes.Bytes; | |
import net.openhft.chronicle.wire.BinaryWire; | |
import net.openhft.chronicle.wire.TextWire; | |
/** | |
* Created by daniel on 09/10/2015. | |
*/ | |
public class WireDocumentTypeDemo { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package chronicle.demo; | |
import net.openhft.chronicle.bytes.Bytes; | |
import net.openhft.chronicle.wire.BinaryWire; | |
import net.openhft.chronicle.wire.TextWire; | |
/** | |
* Created by daniel on 09/10/2015. | |
*/ | |
public class WireDocumentDemo { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package chronicle.demo; | |
import net.openhft.chronicle.bytes.Bytes; | |
import net.openhft.chronicle.bytes.IORuntimeException; | |
import net.openhft.chronicle.wire.*; | |
import java.util.function.Function; | |
public class WireDemo { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.util.Properties; | |
import javax.naming.Context; | |
import javax.naming.NamingException; | |
import javax.naming.directory.*; | |
public class LDAPTest { | |
public void run() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import net.openhft.chronicle.bytes.Bytes; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.Mode; | |
import org.openjdk.jmh.annotations.Scope; | |
import org.openjdk.jmh.annotations.State; | |
import org.openjdk.jmh.infra.Blackhole; | |
import org.openjdk.jmh.runner.Runner; | |
import org.openjdk.jmh.runner.RunnerException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void allocationRegressionTest(){ | |
long limit = 1<<20; | |
ByteWatcher bw = new ByteWatcher(); | |
bw.onByteWatch((t, size) -> | |
//Allocation breached - cause an assertion to happen | |
assertTrue(String.format("%s exceeded limit: %d using: %d%n", | |
t.getName(), limit, size), false) | |
, limit); | |
//Run your program here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.ReentrantLock; | |
public class LockVsSync { | |
private static final boolean COORDINATED_OMISSION = Boolean.getBoolean("coordinatedOmission"); | |
//Either run testing Lock or testing synchronized | |
private static final boolean IS_LOCK = Boolean.getBoolean("isLock"); | |
private static final int NUM_THREADS = Integer.getInteger("numThreads"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package util; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.Scope; | |
import org.openjdk.jmh.annotations.State; | |
import org.openjdk.jmh.runner.Runner; | |
import org.openjdk.jmh.runner.options.Options; | |
import org.openjdk.jmh.runner.options.OptionsBuilder; | |
@State(Scope.Benchmark) |