This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am clohfink on github. | |
* I am clohfink (https://keybase.io/clohfink) on keybase. | |
* I have a public key ASBMVgXJ55fnahgb7tAViS8F-8hwuLeXFbs2Y4rMmz4oQAo | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION topkState ( state tuple<int, map<text, int>>, val text ) | |
CALLED ON NULL INPUT RETURNS tuple<int, map<text, int>> LANGUAGE java AS ' | |
java.util.Map<String, Integer> m = state.getMap(1, String.class, Integer.class); | |
int current = m.get(val) == null? 1 : m.get(val) + 1; | |
if (val != null) { | |
state.setInt(0, state.getInt(0) + 1); | |
if (state.getInt(0) < 100) { | |
m.put(val, current); | |
} | |
else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@OutputTimeUnit(TimeUnit.NANOSECONDS) | |
@State(Scope.Benchmark) | |
public class ThreadLocalBenchmark { | |
@State(Scope.Benchmark) | |
public static class ThreadLocalExecutorPool extends JMXEnabledThreadPoolExecutor { | |
protected final ThreadLocal<Long> startTime = new ThreadLocal<Long>(); | |
public final Counter wallTime; | |
private ThreadMXBean bean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@OutputTimeUnit(TimeUnit.NANOSECONDS) | |
@State(Scope.Benchmark) | |
public class ThreadLocalBenchmark { | |
@State(Scope.Benchmark) | |
public static class ThreadLocalExecutorPool extends JMXEnabledThreadPoolExecutor { | |
protected final ThreadLocal<Long> startTime = new ThreadLocal<Long>(); | |
public final Counter wallTime; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@OutputTimeUnit(TimeUnit.NANOSECONDS) | |
@State(Scope.Benchmark) | |
public class ThreadLocalBenchmark { | |
@State(Scope.Benchmark) | |
public static class ThreadLocalExecutorPool extends JMXEnabledThreadPoolExecutor { | |
protected final ThreadLocal<Long> startTime = new ThreadLocal<Long>(); | |
public final Counter wallTime; | |
public final Meter tasksAdded; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Licensed to Tomaz Muraus under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# Tomaz muraus licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |