Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Szymon Stępniak wololock

🏠
Working from home
Block or report user

Report or block wololock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wololock
wololock / console.log
Created Jun 25, 2019
Groovy Trampoline Closure benchmark results (Groovy 3.0.0-beta-1)
View console.log
$ ./gradlew clean jmh --no-daemon
> Task :jmhRunBytecodeGenerator
Processing 0 classes from /home/wololock/workspace/groovy-closure-trampoline-example/build/classes/java/jmh with "reflection" generator
Processing 5 classes from /home/wololock/workspace/groovy-closure-trampoline-example/build/classes/groovy/jmh with "reflection" generator
Writing out Java source to /home/wololock/workspace/groovy-closure-trampoline-example/build/jmh-generated-sources and resources to /home/wololock/workspace/groovy-closure-trampoline-example/build/jmh-generated-resources
# Warmup Iteration 1: UTING [13s]
> Task :jmh
# JMH version: 1.21
# VM version: JDK 1.8.0_201, Java HotSpot(TM) 64-Bit Server VM, 25.201-b09
@wololock
wololock / console.log
Last active Jun 25, 2019
Groovy Trampoline Closure benchmark results (Groovy 2.5.7)
View console.log
$ ./gradlew clean jmh --no-daemon
> Task :jmhRunBytecodeGenerator
Processing 0 classes from /home/wololock/workspace/groovy-closure-trampoline-example/build/classes/java/jmh with "reflection" generator
Processing 5 classes from /home/wololock/workspace/groovy-closure-trampoline-example/build/classes/groovy/jmh with "reflection" generator
Writing out Java source to /home/wololock/workspace/groovy-closure-trampoline-example/build/jmh-generated-sources and resources to /home/wololock/workspace/groovy-closure-trampoline-example/build/jmh-generated-resources
# Warmup Iteration 1: UTING [6s]
> Task :jmh
# JMH version: 1.21
# VM version: JDK 1.8.0_201, Java HotSpot(TM) 64-Bit Server VM, 25.201-b09
View reflect-config.json
[
{
"name":"[Ljava.lang.Object;",
"allDeclaredFields":true,
"allDeclaredMethods":true
},
{
"name":"[Ljava.lang.String;",
"allDeclaredFields":true,
"allDeclaredMethods":true,
View qwe.groovy
def listA = ['ABC', 'DEF', 'GHI', 'JKL', 'MNO', 'PQR']
def listB = [1,2,1,1,1,1]
def pairs = [listA, listB].transpose()
def map = [:]
pairs.each{ map << (it as MapEntry) }
println(map)
View GroovyHttpServer.groovy
import com.sun.net.httpserver.HttpExchange
import com.sun.net.httpserver.HttpHandler
import com.sun.net.httpserver.HttpServer
import groovy.transform.CompileStatic
import groovy.transform.TypeChecked
@CompileStatic
@TypeChecked
class GroovyHttpServer {
View reflect-config.json
[
{
"name":"RandomNumber$Foo",
"allDeclaredFields":true,
"allDeclaredMethods":true,
"allDeclaredConstructors":true
},
{
"name":"groovy.lang.Buildable",
View qwe.groovy
import groovy.transform.Field
def foo(param) {
println "The param is ${param}"
}
@Field
def dict = [:]
def register(String key, Closure cl) {
View brainfuck.hs
import Data.Char
import Data.Word
executeString :: String -> String -> Maybe String
executeString source input = process (0,0, repeat (0 :: Word8), [], input)
where
-- ip - instruction pointer
-- dp - data pointer
-- reg - data registry
View dgm.groovy
@Grab(group = "org.reflections", module = "reflections", version = "0.9.11")
@Grab(group = "org.slf4j", module = "slf4j-simple", version = "1.7.25")
import groovy.json.JsonOutput
import org.codehaus.groovy.reflection.GeneratedMetaMethod
import org.reflections.Reflections
def reflections = new Reflections("org.codehaus.groovy.runtime")
def json = reflections.getSubTypesOf(GeneratedMetaMethod).collect {
View dgm.json
[
{
"name": "org.codehaus.groovy.runtime.dgm$0",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "org.codehaus.groovy.runtime.dgm$1",
You can’t perform that action at this time.