Skip to content

Instantly share code, notes, and snippets.

ab -k -c 10 -n 100000 http://127.0.0.1/small
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
ab -k -c 10 -n 100000 http://127.0.0.1/dw-bench
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
ab -k -c 10 -n 100000 http://127.0.0.1/fast
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
public class SequenceableCollection {
public static <T> List<T> streamContents(Supplier<List<T>> constructor, Consumer<Consumer<T>> block) {
List<T> result = constructor.get();
block.accept(each -> result.add(each));
return result;
}
public static List<String> example(ResultSet rs) {
return streamContents(ArrayList::new, (accumulator) -> {
@marschall
marschall / FasterGame.java
Created September 10, 2016 09:46 — forked from jackmott/FasterGame.java
Faster Java Game
class Vector
{
public float x, y, z;
public Vector(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
$JAVA_HOME/bin/jdeprscan --for-removal --release 9 oracle-javaee-api-7.0.jar
interface javax/ejb/EJBContext method getCallerIdentity has return type Ljava/security/Identity; deprecated FOR REMOVAL
interface javax/ejb/EJBContext method isCallerInRole has parameter type Ljava/security/Identity; deprecated FOR REMOVAL
@marschall
marschall / glassfish-all-jdeprscan.txt
Created October 13, 2016 14:21
jdeprscan on application servers
class com/sun/ejb/containers/EJBContextImpl uses type java/security/Identity deprecated FOR REMOVAL
class com/sun/ejb/containers/EJBContextImpl uses method in type java/security/Identity deprecated FOR REMOVAL
class com/sun/ejb/containers/EJBContextImpl method getCallerIdentity has return type Ljava/security/Identity; deprecated FOR REMOVAL
class com/sun/ejb/containers/EJBContextImpl method isCallerInRole has parameter type Ljava/security/Identity; deprecated FOR REMOVAL
class com/sun/enterprise/security/PolicyLoader uses type javax/security/auth/Policy deprecated FOR REMOVAL
class com/sun/enterprise/security/PolicyLoader uses method in type javax/security/auth/Policy deprecated FOR REMOVAL
class com/sun/enterprise/security/PolicyLoader uses method in type javax/security/auth/Policy deprecated FOR REMOVAL
class com/sun/enterprise/security/ssl/GlassfishSSLSupport uses type [Ljavax/security/cert/X509Certificate; deprecated FOR REMOVAL
class com/sun/enterprise/security/ssl/GlassfishSSLSupport uses type javax/sec
@marschall
marschall / Graal
Created August 20, 2017 19:35
UUID parsing performance
$java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-b13)
OpenJDK 64-Bit Graal VM (build 25.71-b01-internal-jvmci-0.30, mixed mode)
Result "com.github.marschall.charsequences.ParseUuidBenchmark.parseJdk":
2.411 ±(99.9%) 0.014 ops/us [Average]
(min, avg, max) = (2.124, 2.411, 2.462), stdev = 0.043
CI (99.9%): [2.396, 2.425] (assumes normal distribution)
@marschall
marschall / jmc-jpms-warning.txt
Created September 22, 2017 15:35
JMC JPMS Warning
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.emf.ecore.xmi.impl.XMLHandler (file:/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/missioncontrol/plugins/org.eclipse.emf.ecore.xmi_2.12.0.v20160420-0247.jar) to method com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy.getEncoding()
WARNING: Please consider reporting this to the maintainers of org.eclipse.emf.ecore.xmi.impl.XMLHandler
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
@marschall
marschall / val.jsh
Created March 30, 2018 08:57
val is not a keyword
class val {}
val val = new val()