Skip to content

Instantly share code, notes, and snippets.

Avatar

Stuart Williams pidster

View GitHub Profile
View maven-caching-concourse-task.yaml
---
platform: linux
image_resource:
type: registry-image
source:
repository: adoptopenjdk/openjdk11
tag: alpine
inputs:
View jmh_clock_comparisons.txt
Benchmark Mode Cnt Score Error Units
TimeSourceComparisonBenchmarks.aeonNanosMxBeanThreadCpuTime thrpt 200 0.001 ± 0.001 ops/ns
TimeSourceComparisonBenchmarks.aeonNanosSystemNanoTime thrpt 200 0.023 ± 0.001 ops/ns
TimeSourceComparisonBenchmarks.aeonTickingClock thrpt 200 0.341 ± 0.008 ops/ns
TimeSourceComparisonBenchmarks.clockSystemUTC thrpt 200 0.023 ± 0.001 ops/ns
TimeSourceComparisonBenchmarks.systemCurrentTimeMillis thrpt 200 0.023 ± 0.001 ops/ns
TimeSourceComparisonBenchmarks.systemNanoTime thrpt 200 0.026 ± 0.001 ops/ns
TimeSourceComparisonBenchmarks.aeonNanosMxBeanThreadCpuTime avgt 200 1202.577 ± 25.104 ns/op
TimeSourceComparisonBenchmarks.aeonNanosSystemNanoTime avgt 200 38.857 ± 0.571 ns/op
TimeSourceComparisonBenchmarks.aeonTickingClock avgt 200 3.506 ± 0.403 ns/op
View java_file_rw_tests
# https://mechanical-sympathy.blogspot.co.uk/2011/12/java-sequential-io-performance.html
# MBP 13" 2015
#
# Run 01
RandomAccessFile write=332,251,784 read=505,024,351 bytes/sec
RandomAccessFile write=323,704,903 read=549,061,662 bytes/sec
RandomAccessFile write=340,482,128 read=745,744,196 bytes/sec
RandomAccessFile write=344,259,539 read=675,796,073 bytes/sec
RandomAccessFile write=341,376,005 read=750,595,565 bytes/sec
BufferedStreamFile write=36,715,175 read=193,989,912 bytes/sec
View keybase.md

Keybase proof

I hereby claim:

  • I am pidster on github.
  • I am pidster (https://keybase.io/pidster) on keybase.
  • I have a public key whose fingerprint is 0D7E 15FB 2B3A D181 21B9 74C8 0B66 2050 6259 0808

To claim this, I am signing this object:

View gist:656e12c4c6dd9152b3aa
public class AtomicLongThreadedTimeSupplier implements Supplier<Instant> {
private static final AtomicLong counter = new AtomicLong();
private final AtomicLong epochMilli = new AtomicLong();
private final long timeout;
public AtomicLongThreadedTimeSupplier() {
this(1000L);
View gist:4623376
#!/bin/bash
# PURPOSE
#
# The Gradle wrapper[1] is a simple and convenient way of making Gradle
# builds self-contained and reproducible. However, in multi-project
# builds, it can be cumbersome to type in relative paths e.g.:
# ./gradlew # when in root
# ../gradlew # when in subdir
#
@pidster
pidster / gist:4594060
Created Jan 22, 2013
Sample of runOnWorker() implementation.
View gist:4594060
public void runOnWorker(final Handler<Void> handler) {
Context context = getOrAssignContext();
context.executeOnWorker(new Runnable() {
public void run() {
handler.handle(null);
}
});
}
@pidster
pidster / hack.sh
Created Mar 31, 2012 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#