Skip to content

Instantly share code, notes, and snippets.

View jzillmann's full-sized avatar

Johannes Zillmann jzillmann

View GitHub Profile
@jzillmann
jzillmann / string-concatenation_JDK7.json
Last active March 19, 2021 13:40
Multi file gist for testing JMH visualiser
[
{
"benchmark" : "io.morethan.javabenchmarks.string.ConcatenatedStringBenchmark.concat",
"mode" : "thrpt",
"threads" : 1,
"forks" : 5,
"warmupIterations" : 10,
"warmupTime" : "1 s",
"warmupBatchSize" : 1,
"measurementIterations" : 20,
@jzillmann
jzillmann / electron.js
Created September 29, 2019 12:19
Basic electron.js
const { app, BrowserWindow } = require('electron');
const path = require('path')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
function createWindow() {
const mode = process.env.NODE_ENV;
mainWindow = new BrowserWindow({
@jzillmann
jzillmann / build-snippets.gradle
Last active August 12, 2018 05:02
Gradle Snippets
// Add dependsOn to existing task
test.dependsOn jar
test.dependsOn tasks.getByPath(':submodule1:shadowJar')
// Update gradle wrapper in a project
gradle wrapper
@jzillmann
jzillmann / string-concatenation_jdk8.json
Last active January 25, 2018 22:50
JMH benchmark result for comparing different ways of string concatenation in Java
[
{
"benchmark" : "io.morethan.javabenchmarks.string.ConcatenatedStringBenchmark.concat",
"mode" : "thrpt",
"threads" : 1,
"forks" : 5,
"warmupIterations" : 10,
"warmupTime" : "1 s",
"warmupBatchSize" : 1,
"measurementIterations" : 20,
@jzillmann
jzillmann / string-concatenation_jdk7.json
Created January 25, 2018 22:49
JMH benchmark result for comparing different ways of string concatenation in Java
[
{
"benchmark" : "io.morethan.javabenchmarks.string.ConcatenatedStringBenchmark.concat",
"mode" : "thrpt",
"threads" : 1,
"forks" : 5,
"warmupIterations" : 10,
"warmupTime" : "1 s",
"warmupBatchSize" : 1,
"measurementIterations" : 20,
@jzillmann
jzillmann / jmh.gradle
Last active April 9, 2023 17:14
Integrating JMH into gradle
// Adds JMH integration to a project.
// Considering putting this file into gradle/ folder and include it with:
// apply from: rootProject.file('gradle/jmh.gradle')
sourceSets {
jmh {
compileClasspath += sourceSets.test.runtimeClasspath
runtimeClasspath += sourceSets.test.runtimeClasspath
}
}