Skip to content

Instantly share code, notes, and snippets.

@jproyo
jproyo / a.md
Created March 8, 2020 09:29 — forked from monadplus/profiling_haskell.md
Profiling in Haskell

You'll generally want to look at:

  • heap
  • stack
  • gc profiles

Do not get bogged down in microoptimizations before you've assessed any macro optimizations that are available. IO and the choice of algorithm dominate any low level changes you may make. In the end you have to think hard about your code!

Topos> For example, if i see that a particular pure function is taking a  long time relative to the rest of the code, and that it's Text, and I'm seeing ARR_WORDS rise linearly in the heap, I probably have a thunk-based memory leak. This is knowledge you build up over time.
@jproyo
jproyo / gist:28faf139bad26517f45755db21b59f6b
Created July 5, 2016 15:42 — forked from eduardocardoso/gist:82a629882ddb02ab3677
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@jproyo
jproyo / git_move.sh
Created November 16, 2012 14:45
moves a folder from one git repo into another repo with history intact
#!/usr/bash
# Usage:
# ./git_move.sh git@repo_site.com:/my_repo.git origin/folder/path/ /destination/repo/path/ new/folder/path/
repo=$1
folder=$2
dest_repo=$3
dest_folder=$4
clone_folder='__git_clone_repo__'