Skip to content

Instantly share code, notes, and snippets.

View buchgr's full-sized avatar

Jakob Buchgraber buchgr

  • Rust @google
  • Munich, Germany
  • 17:26 (UTC -12:00)
View GitHub Profile
Benchmark Mode Thr Count Sec Mean Mean error Units
b.NextEventLoopBenchmark.existingNext16 thrpt 1 100 1 0.387 0.001 ops/ms
b.NextEventLoopBenchmark.existingNext19 thrpt 1 100 1 0.386 0.002 ops/ms
b.NextEventLoopBenchmark.newNext16 thrpt 1 100 1 0.828 0.003 ops/ms
b.NextEventLoopBenchmark.newNext8 thrpt 1 100 1 0.828 0.003 ops/ms
b.NextEventLoopBenchmark.newNext19 thrpt 1 100 1 0.371 0.002 ops/ms
b.NextEventLoopBenchmark.newNext9 thrpt 1 100 1 0.371 0.002 ops/ms
Benchmark Mode Thr Count Sec Mean Mean error Units
b.NextEventLoopBenchmark.newNext16 thrpt 1 200 1 8.562 0.006 ops/ms
b.NextEventLoopBenchmark.newNext19 thrpt 1 200 1 8.500 0.005 ops/ms
b.NextEventLoopBenchmark.newNext8 thrpt 1 200 1 8.567 0.007 ops/ms
b.NextEventLoopBenchmark.newNext9 thrpt 1 200 1 8.434 0.007 ops/ms
b.NextEventLoopBenchmark.existingNext16 thrpt 1 200 1 8.485 0.005 ops/ms
b.NextEventLoopBenchmark.existingNext19 thrpt 1 200 1 8.506 0.003 ops/ms
package benchmark;
import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
import java.util.concurrent.atomic.AtomicInteger;
public class NextEventLoopBenchmark {
@GenerateMicroBenchmark
public void newNext8 () {
static class Node
{
int val;
Node left;
Node right;
Node(int val, Node left, Node right)
{
this.val = val;
this.left = left;
{-WETT-}
perms :: [Char] -> [[Char]]
perms [] = [""]
perms xs = reverse $ sort $ nub [x:y | x <- xs, y <- perms $ delete x xs]
{-TTEW-}
wordsOfLength :: [Char] -> Integer -> [[Char]]
wordsOfLength alphabet n | n <= 0 = [""]
| otherwise = [a:b | a <- alphabet, b <- wordsOfLength alphabet (n-1)]