Benchmarkjs : a very small tool to compare speed

Wanting to quickly figure out which way is the fastest ? Want to see median times in µs ? Download that module : https://gist.github.com/libetl/952e026f889be1cc7cdb3b42767ea845 And call benchmark that way : (copy/paste that code, change 'forThisWork' - what to measure, 'theContestants '- who to measure, and 'seedInit' - what data should it use) benchmark({theContestants: {naive: seed… Read More »

How to crash javac (jdk8) for free

This simple snippet can cause javac (from the JDK 8) to crash : public class TestExtendConsumer { @FunctionalInterface public interface NumberConsumer< E extends Number> extends java.util.function.Consumer< E>{void accept(E number);} private static < E extends Number> void extend(E number) { System.out.println(number); } public static void main(String[] args) { NumberConsumer numberConsumer = TestExtendConsumer::extend; numberConsumer.accept(1); } } Impressive.… Read More »