Skip to content

Instantly share code, notes, and snippets.

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

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

@Painezor
Painezor / Checks.py
Last active April 18, 2024 05:22
Built-in Checks for the commands extension of discord py
@commands.guild_only()
# Command cannot be used in private messages.
@commands.dm_only()
# Command can only be used in private messages.
@commands.is_owner()
# Command can only be used by the bot owner.
@commands.is_nsfw()
@henri
henri / fortigate_basic_cheat_sheet.txt
Last active April 18, 2024 05:21
Fortigate Command Line Cheat Sheet
# get basic system informaton (including version)
get system status
# overview of hardware interfaces
get system interface physical
# details of a single network interface,
get hardware nic <nic-name>
# kind of hidden command to see more interface stats such as errors
@pyrou
pyrou / docker-compose.yml
Last active April 18, 2024 05:20
Use https://traefik.me SSL certificates for local HTTPS without having to touch your /etc/hosts or your certificate CA.
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
@jctosta
jctosta / screen_cheatsheet.markdown
Last active April 18, 2024 05:19
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@ttimasdf
ttimasdf / README.md
Last active April 18, 2024 05:17
Integrate Git diffs and commits with Word DOCX files
@ikr4-m
ikr4-m / install.sh
Created June 25, 2022 10:04
Hyper-V Enhanced Session for Debian
#!/bin/sh
# This script based on linux-vm-tools for Ubuntu 22.02.
# Thanks to https://github.com/Hinara/linux-vm-tools/ to script
# This script is for Ubuntu 22.04 Jammy Jellyfish to download and install XRDP+XORGXRDP via
# source.
#
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
#
@isuvorov
isuvorov / __dirname.js
Created April 18, 2024 05:09
ESM __dirname and __filename
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
export const getFilename = (meta) => fileURLToPath(meta.url);
export const getDirname = (meta) => dirname(getFilename(meta));
const __filename = getFilename(import.meta);
const __dirname = getDirname(import.meta);
@tsutsui
tsutsui / PC-8801MA-capacitors.txt
Created May 7, 2016 20:03
PC-8801MA の電源ユニットとメインボードで使われている電解コンデンサ一覧
--------------------------------------------------------
PC-8801MA の電源ユニットで使われている電解コンデンサ一覧
--------------------------------------------------------
C605 200V 560uF ルビコン MXP 高圧1次側平滑
C609 25V 100uF 日ケミ KMC 1次側電圧制御用?
C612 63V 22uF 日ケミ KMC 1次側電圧制御用?
C613 25V 470uF 日ケミ KMC 1次側電圧制御用?