Skip to content

Instantly share code, notes, and snippets.

Philip Roman PhilipRoman

View GitHub Profile
@PhilipRoman
PhilipRoman / Main.java
Last active Apr 27, 2020
WebSocketServer port test
View Main.java
import java.net.*;
import java.io.*;
import org.java_websocket.server.*;
import org.java_websocket.*;
import org.java_websocket.handshake.*;
public class Main extends WebSocketServer {
public static final int PORT = Integer.getInteger("port", 3141);
@PhilipRoman
PhilipRoman / Main.java
Last active Apr 21, 2018
Java performance anomaly: the loop with 'beta' method is 2x slower than loop with 'alpha' even though the methods are identical.
View Main.java
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
public class Main {
private static final int N = 1_000_000;
private static Field stringBytes;
private static String testString;
static {
// setup test string:
You can’t perform that action at this time.