Skip to content

Instantly share code, notes, and snippets.

View nnethercote's full-sized avatar

Nicholas Nethercote nnethercote

View GitHub Profile
@nnethercote
nnethercote / gist:10ec6918e02029e7609c9bb8d594b986
Last active November 4, 2016 14:42
Bash functions for running DHAT and Massif on rustc-benchmarks
function rustc-get-command
{
local rust=$1
local stage=$2
local prefix=$3
echo "Getting command"
local rustc=/home/njn/moz/$rust/x86_64-unknown-linux-gnu/$stage/bin/rustc
make clean > $prefix-make-clean-out 2>&1
CARGO_OPTS='-v' RUSTC=$rustc make > $prefix-make1-out 2>&1 || return 1
48 440,603,058,993 4,844,424,224 4,669,713,327 174,305,201 405,696
96.39% (4,669,713,327B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
->68.33% (3,310,277,848B) 0x523C08C: mallocx (jemalloc.c:2173)
| ->26.42% (1,279,660,800B) 0x7E6F0BD: rustc::hir::lowering::LoweringContext::lower_expr
| | ->11.12% (538,800,192B) 0x7E3618B: <collections::vec::Vec<T> as core::iter::traits::FromIterator<T>>::from_iter
| | | ->11.12% (538,800,192B) 0x7E6DA80: rustc::hir::lowering::LoweringContext::lower_expr
| | | ->06.95% (336,749,184B) 0x7E3618B: <collections::vec::Vec<T> as core::iter::traits::FromIterator<T>>::from_iter
| | | | ->06.95% (336,749,184B) 0x7E6DA80: rustc::hir::lowering::LoweringContext::lower_expr
| | | |
| | | ->04.17% (202,049,280B) 0x7E2CF8B: <collections::vec::Vec<T> as core::iter::traits::FromIterator<T>>::from_iter
@nnethercote
nnethercote / quasi-complement.txt
Last active July 2, 2017 17:55
The quasi-complement of J David Eisenberg's "Linus’s Rant Rewritten"
"This is just sh*t"
"stupid new gcc header file crap"
"the crap"
"just incompetent and out to lunch"
"The above code is sh*t, and it generates shit code"
"crazy"
"idiotic"
"half-way sane"
"compiler-masturbation"
"frankly... you damn well didn't do the right thing to begin with"
@nnethercote
nnethercote / wake.cpp
Created August 21, 2015 05:06
Program that triggers N wakeups per second
#include <mach/mach_init.h>
#include <mach/task.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
static void