Skip to content

Commit

Permalink
Move perf benchmarks into test/perf
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralBShah committed Jan 5, 2012
1 parent a99815c commit ced3aad
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 59 deletions.
58 changes: 2 additions & 56 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ JULIAHOME = ..
include ../Make.inc

default: core numbers strings corelib hashing arrayops
extra: unicode perf
extra: unicode
all: default extra

core numbers strings corelib hashing arrayops:
Expand All @@ -13,61 +13,7 @@ unicode:
@$(MAKE) -C $@
@../julia $@.j

perf:
ifneq ($(MAKECMDGOALS),perf)
$(QUIET_JULIA) ../julia [email protected] >/dev/null
else
@../julia [email protected] | perl -nle '@_=split/,/; printf "%-14s %7.3f\n", $$_[1], $$_[2]'
endif

bin/perf%: perf.cpp
g++ -O$* ../external/openblas-v0.1alpha2.4/libopenblas.a $< -o $@

benchmarks/c.csv: bin/perf0 bin/perf1 bin/perf2 bin/perf3
rm -f $@
mkdir -p benchmarks
for t in 1 2 3 4 5; do bin/perf0; done >>$@
for t in 1 2 3 4 5; do bin/perf1; done >>$@
for t in 1 2 3 4 5; do bin/perf2; done >>$@
for t in 1 2 3 4 5; do bin/perf3; done >>$@

benchmarks/julia.csv: perf.j
../julia $< >$@

benchmarks/python.csv: perf.py
python $< >$@

benchmarks/matlab.csv: perf.m
matlab -nosplash -nodesktop -nojvm -r 'perf;exit' 2>/dev/null | grep '^matlab,' >$@

benchmarks/octave.csv: perf.m
octave -q --eval perf 2>/dev/null >$@

benchmarks/r.csv: perf.R
cat $< | R --vanilla --slave 2>/dev/null >$@

benchmarks/javascript.csv: perf.js
node $< >$@

BENCHMARKS = \
benchmarks/c.csv \
benchmarks/julia.csv \
benchmarks/python.csv \
benchmarks/matlab.csv \
benchmarks/octave.csv \
benchmarks/r.csv \
benchmarks/javascript.csv

benchmarks.csv: bin/collect.pl $(BENCHMARKS)
$(QUIET_PERL) $^ >$@

benchmarks.txt: bin/table.pl benchmarks.csv
$(QUIET_PERL) $^ >$@

benchmark: benchmarks.txt

clean:
@$(MAKE) -C unicode $@
@rm -rf bin/perf* benchmarks benchmarks.csv

.PHONY: all core hashing arrayops unicode perf benchmark clean
.PHONY: all core hashing arrayops unicode clean
File renamed without changes.
60 changes: 60 additions & 0 deletions test/perf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
JULIAHOME = ../..
include $(JULIAHOME)/Make.inc

perf:
ifneq ($(MAKECMDGOALS),perf)
$(QUIET_JULIA) $(JULIAHOME)/julia [email protected] >/dev/null
else
@$(JULIAHOME)/julia [email protected] | perl -nle '@_=split/,/; printf "%-14s %7.3f\n", $$_[1], $$_[2]'
endif

bin/perf%: perf.cpp
$(CXX) -O$* $(JULIAHOME)/external/openblas-v0.1alpha2.4/libopenblas.a $< -o $@

benchmarks/c.csv: bin/perf0 bin/perf1 bin/perf2 bin/perf3
rm -f $@
mkdir -p benchmarks
for t in 1 2 3 4 5; do bin/perf0; done >>$@
for t in 1 2 3 4 5; do bin/perf1; done >>$@
for t in 1 2 3 4 5; do bin/perf2; done >>$@
for t in 1 2 3 4 5; do bin/perf3; done >>$@

benchmarks/julia.csv: perf.j
../julia $< >$@

benchmarks/python.csv: perf.py
python $< >$@

benchmarks/matlab.csv: perf.m
matlab -nosplash -nodesktop -nojvm -r 'perf;exit' 2>/dev/null | grep '^matlab,' >$@

benchmarks/octave.csv: perf.m
octave -q --eval perf 2>/dev/null >$@

benchmarks/r.csv: perf.R
cat $< | R --vanilla --slave 2>/dev/null >$@

benchmarks/javascript.csv: perf.js
node $< >$@

BENCHMARKS = \
benchmarks/c.csv \
benchmarks/julia.csv \
benchmarks/python.csv \
benchmarks/matlab.csv \
benchmarks/octave.csv \
benchmarks/r.csv \
benchmarks/javascript.csv

benchmarks.csv: bin/collect.pl $(BENCHMARKS)
$(QUIET_PERL) $^ >$@

benchmarks.txt: bin/table.pl benchmarks.csv
$(QUIET_PERL) $^ >$@

benchmark: benchmarks.txt

clean:
@rm -rf bin/perf* benchmarks benchmarks.csv

.PHONY: all perf clean
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/perf.cpp → test/perf/perf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#include <complex>
#include <algorithm>

#include "../external/openblas-v0.1alpha2.4/cblas.h"
#include "../../external/openblas-v0.1alpha2.4/cblas.h"

#define DSFMT_MEXP 19937
#include "../external/random/dsfmt-2.1/dSFMT.c"
#include "../external/random/randmtzig.c"
#include "../../external/random/dsfmt-2.1/dSFMT.c"
#include "../../external/random/randmtzig.c"

using namespace std;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ced3aad

Please sign in to comment.