Skip to content

Instantly share code, notes, and snippets.

View parttimenerd's full-sized avatar

Johannes Bechberger parttimenerd

View GitHub Profile
@ibaca
ibaca / GcProfiler.java
Created August 10, 2019 16:01
Memory profiling extension for JMH.
package com.intendia.jmh;
import static java.lang.Double.NaN;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.openjdk.jmh.results.AggregationPolicy.AVG;
import static org.openjdk.jmh.results.AggregationPolicy.MAX;
import static org.openjdk.jmh.results.AggregationPolicy.SUM;
import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@ShigekiKarita
ShigekiKarita / CMakeLists.txt
Last active August 29, 2015 14:11
My CMake Project Template
cmake_minimum_required(VERSION 2.8.4)
project(MyCMakeTemplate)
## Configure compiler and libraries : Boost
add_compile_options(-std=c++1y -Wall -Wextra)
include_directories(${PROJECT_SOURCE_DIR}/include)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@stared
stared / software_for_scientists.md
Last active May 9, 2024 13:46
Software for scientists: community-edited list of general-purpose software for scientists.

Software for scientists

Some things takes much less time and stress once you know the right tool. Below, there is a community edited list of software for scientists.

Text editors

in General purpose text/code editors. It may be better to have a good editor for everything, than different ones for different languages, scripts, notes.

@parttimenerd
parttimenerd / notes_on_pool.md
Last active December 20, 2015 22:19
Random notes on POOL (a new programming language)...

#VM notes

  • parallelize the variable lookup
    • e.g. one thread for the backward module chain one for the forward and one for the class chain
  • cache the variable already looked up
    • probably with a hashtable and a global no_attribute_added flag

#Syntax notes

  • force spaces (when it's neccessary)
  • trim the syntax spec and extend it later - to make you're that the grammar can be written at one or two weekends
@jhclark
jhclark / latency.txt
Created May 31, 2012 19:58 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
Read 1 MB sequentially from SSD 1,000,000 ns 1 ms 4X memory
@senko
senko / onchange.sh
Last active July 14, 2023 07:54
OnChange - Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of