Skip to content

Instantly share code, notes, and snippets.

View leoxlin's full-sized avatar
:shipit:
Probably Shipping Code Furiously

Leo X. Lin leoxlin

:shipit:
Probably Shipping Code Furiously
View GitHub Profile

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea

@poweld
poweld / party.sh
Last active November 6, 2018 18:50
Annoy your coworkers with massive emoji banners in Slack
function party {
if ! command -v figlet; then
if ! command -v brew; then
echo Requires figlet or brew to be installed
return 1
fi
brew install figlet
fi
if [ -z "$1" ]; then
@matteosb
matteosb / pom.xml
Last active June 16, 2018 14:11
Maven Build for a Scala Application
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>replace-me</groupId>
<artifactId>sample</artifactId>
<version>1.0-SNAPSHOT</version>
@rene-aguirre
rene-aguirre / ctrlp_speed.vim
Created September 13, 2012 15:45
Speed up ctrlp with VCS
" ctrlp.vim plug-in
" open files extra files in hidden buffers
let g:ctrlp_open_multiple_files = '1jr'
" indexing speed up
if has("unix")
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'cd %s && git ls-files'],
\ 2: ['.hg', 'hg --cwd %s locate -I .'],
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active September 22, 2024 08:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname