Skip to content

Instantly share code, notes, and snippets.

@bmorris591
bmorris591 / SelfDescription.java
Last active March 18, 2017 15:14
Little JavaFX application to generate XKCD-like self descriptive image
package com.boris.testbench;/**
* Created by Boris on 18/03/2017.
*/
import java.io.IOException;
import java.util.stream.Stream;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Application;
@bmorris591
bmorris591 / MyBenchmark.java
Last active October 7, 2016 06:08
A benchmark using the JMH framework to compare methods of tokenizing a `String`.
@OutputTimeUnit(TimeUnit.SECONDS)
@State(Scope.Thread)
public class MyBenchmark {
private Pattern pattern;
private String warandpeace;
@Setup
public void prepare() {
@bmorris591
bmorris591 / App.java
Created April 30, 2015 12:55
JMH Benchmark of `enum` iterations techniques
public class App {
public static void main(final String[] args) throws Exception {
Options opts = new OptionsBuilder()
.include(".*")
.warmupIterations(10)
.measurementIterations(10)
.forks(10)
.resultFormat(ResultFormatType.TEXT)
.build();