Skip to content

Instantly share code, notes, and snippets.

@sharrissf
sharrissf / gist:720867
Created November 29, 2010 23:59
Compare the construction of Quartz jobs between Quartz 1.8.4 and Quartz 2.0
//Quartz 1.8.4 Example 2
// First we must get a reference to a scheduler
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched = sf.getScheduler();
log.info("------- Initialization Complete -----------");
log.info("------- Scheduling Jobs -------------------");
// computer a time that is on the next round minute
@sharrissf
sharrissf / gist:700690
Created November 15, 2010 17:58
Direct Memory vs On Heap in Java
import java.nio.ByteBuffer;
import java.util.Random;
public class BufferPerformanceComparison {
public final static int MEGA_BYTE = 1024 * 1024;
public final static long GIGA_BYTE = MEGA_BYTE * 1024;
private final ByteBuffer heapByteBuffer;
private final ByteBuffer offHeapByteBuffer;
private final long dataToLoad;
private final int bufferSize;