Skip to content

Instantly share code, notes, and snippets.

View aiht's full-sized avatar

aiht

  • Australia
View GitHub Profile
@aiht
aiht / bench.c
Last active August 29, 2015 13:58
// Simple function parameter passing style speed test.
// Compiled with
// gcc -O2 -DBUILD_FUNCS -Wall bench.c -c -o funcs.o; gcc -O2 -Wall bench.c funcs.o -o bench
// Some notes:
// Split into two modules to allow realistic -O2 without the compiler being able to avoid doing any work at all.
// Includes the variable argc input and returns the sum for the same reason.
// f_no_params is used as a control for loop overhead.
#include <time.h>
#include <stdio.h>