Skip to content

Instantly share code, notes, and snippets.

View thoughtpolice's full-sized avatar
👊
omae wa mou shindeiru

Austin Seipp thoughtpolice

👊
omae wa mou shindeiru
View GitHub Profile
@thoughtpolice
thoughtpolice / mpsgc.c
Created September 26, 2014 14:54
Concurrent Memory Pool System example: compile with `cc -std=gnu99 -I mps-1.114.0 mpsfmtgc.c mpsgc.c -lpthread`
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <pthread.h>
#include "mps.h"
#include "mpsavm.h"
@thoughtpolice
thoughtpolice / seccomp-bpf.c
Created January 3, 2015 19:31
Raw seccomp-bpf API example.
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <endian.h>
#include <unistd.h>
#include <asm/bitsperlong.h> /* for __BITS_PER_LONG */
#include <linux/filter.h>
#include <linux/seccomp.h> /* for seccomp_data */
#include <linux/types.h>
#include <linux/unistd.h>
@thoughtpolice
thoughtpolice / nixos-install-rackspace.sh
Created April 4, 2015 08:54
Bootstrap script for NixOS Rackspace
#!/usr/bin/env bash
unset CDPATH
DISK=/dev/xvdb
PARTITION=/dev/xvdb1
FSTYPE=ext4
LABEL=nixos
## -----------------------------------------------------------------------------
## -- NixOS configuration template
7.8 vs 7.10.1.20150414
--------------------------------------------------------------------------------
Program Size Allocs Runtime Elapsed TotalMem
--------------------------------------------------------------------------------
...
--------------------------------------------------------------------------------
Min -5.7% -74.5% -18.6% -18.6% -50.0%
Max +4.8% +53.4% +7.0% +7.0% +161.5%
Geometric Mean +0.6% -2.0% -2.7% -2.7% -0.0%
@thoughtpolice
thoughtpolice / perfnotes.md
Last active August 29, 2015 14:19
perfnotes

NOTES:

For generating profiling numbers using bytes allocated, use ticky ticky (for everything), which tells you what functions allocate with what entries, which will give you a reasonable insight.

Reproduce Michal's results for haskell-src-exts.

Bring up: Compile time results for nofib-analyze.

NoFib Results
--------------------------------------------------------------------------------
Program Size Size Size Allocs Allocs Allocs Runtime Runtime Runtime Elapsed Elapsed Elapsed TotalMem TotalMem TotalMem
nofib-7.8 nofib-7.1 nofib-mas nofib-7.8 nofib-7.1 nofib-mas nofib-7.8 nofib-7.1 nofib-mas nofib-7.8 nofib-7.1 nofib-mas nofib-7.8 nofib-7.1 nofib-mas
--------------------------------------------------------------------------------
anna +1.5% +3.3% +3.0% -2.0% -4.3% -4.3% 0.080 0.068 0.069 0.080 0.068 0.069 0.0% 0.0% 0.0%
ansi +5.3% +7.6% +5.9% -2.3% -0.2% -0.2% 0.000 0.000 0.000 0.000 0.000 0.000 0.0% 0.0% 0.0%
atom +5.5% +7.9% +6.2% +0.0% +0.2% +0.2% -2.1% -0.6% -1.0% -2.9% -0.6% -1.0% 0.0% 0.0%
NoFib Results
--------------------------------------------------------------------------------
Program Size Size Size Allocs Allocs Allocs Runtime Runtime Runtime Elapsed Elapsed Elapsed TotalMem TotalMem TotalMem
nofib-7.8 nofib-7.1 nofib-hea nofib-7.8 nofib-7.1 nofib-hea nofib-7.8 nofib-7.1 nofib-hea nofib-7.8 nofib-7.1 nofib-hea nofib-7.8 nofib-7.1 nofib-hea
--------------------------------------------------------------------------------
anna +1.5% +3.3% +3.0% -2.0% -4.3% -4.3% 0.080 0.071 0.071 0.080 0.071 0.071 0.0% 0.0% 0.0%
ansi +5.3% +7.7% +5.9% +0.0% +0.0% +0.0% +2.7% -1.0% +0.6% +2.7% -1.1% +0.5% 0.0% 0.0% 0.0%
atom +5.5% +7.9% +6.2% -0.0% +0.1% +0.1% +1.6% -0.3% -1.1% +1.6% -0.4% -1.1% -25.0% -25.0%
diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs
index 4c469d1..f10fedb 100644
--- a/compiler/simplCore/SimplUtils.hs
+++ b/compiler/simplCore/SimplUtils.hs
@@ -4,7 +4,7 @@
\section[SimplUtils]{The simplifier utilities}
-}
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE CPP, BangPatterns #-}
{
packageOverrides = super: let self = super.pkgs; in
rec {
version1 = "2.0.0";
version2 = "2.0.2";
# Rethinkdb 2.0.0
rethinkDB200 = self.stdenv.lib.overrideDerivation self.rethinkdb (oldAttrs: {
name = "rethinkdb-${version1}-1";
@thoughtpolice
thoughtpolice / tarsnap.bash
Last active August 29, 2015 14:27
Tarsnap shell completion functions
# /etc/bash_completion.d/tarsnap - bash-completion for tarsnap
#
# Besides supplying options it will also try to determine
# when it is suitible to complete what.
#
# Feel free to send comments or suggestions.
shopt -s extglob
_tarsnap ()