Skip to content

Instantly share code, notes, and snippets.

View feeley's full-sized avatar

Marc Feeley feeley

View GitHub Profile
(include "~~lib/_gambit#.scm")
(define-syntax primitive
(lambda (src)
(define (err)
(##raise-expression-parsing-exception
'ill-formed-special-form
src
(##source-strip (##car (##source-strip src)))))
@feeley
feeley / switch-bug2.c
Created June 13, 2013 13:59
Another test program that exhibits poor performance from emscripten's implementation of switch
/*
* This program has similar behavior to switch-bug1.c but
* the JS code generated by emscripten is a bit more complex.
* The sequence of ifs contains some large conditional expressions
* to take into account the code common to several branches of
* the switch.
*/
#include <stdio.h>
@feeley
feeley / switch-bug1.c
Created June 13, 2013 03:22
A test program that exhibits poor performance from emscripten's implementation of switch
/*
* Normal behavior, the program runs in less than a second. And
* when START is 50, there is roughly half as much work to do:
*
* % clang -O2 -g -DSTART=0 switch-bug1.c -o switch-bug1
* % /usr/bin/time ./switch-bug1
* start = 0
* end (sum=200000000)
* 0.93 real 0.92 user 0.00 sys
* % clang -O2 -g -DSTART=50 switch-bug1.c -o switch-bug1