Commit 2ac4c961 authored by nimrod's avatar nimrod
Browse files

Updates.

Changes I had laying around but didn't commit. The README should be
readable now.
parent e3a36bc1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2,3 +2,5 @@ a.out
*.pyc
__pycache__/*
*.swp
prime
go
+9 −2
Original line number Diff line number Diff line
@@ -3,7 +3,11 @@ ENV LEIN_VERSION=2.5.3
ENV LEIN_ROOT=value
WORKDIR /tmp
RUN apt-get update && \
    apt-get install -y python \
    apt-get install -y python-dev \
                       python-pip \
                       build-essential \
                       llvm3.7-dev \
                       python-numpy \
                       python3 \
                       pypy \
                       lua5.1 \
@@ -18,8 +22,10 @@ RUN apt-get update && \
                       clojure1.6 \
                       tcl \
                       time \
                       golang \
                       wget && \
    mkdir /tmp/leiningen && \
    pip install numba && \
    wget --quiet https://github.com/technomancy/leiningen/archive/$LEIN_VERSION.tar.gz -O - | \
    tar -xz -C /tmp/leiningen/ --strip-components=1 && \
    mv /tmp/leiningen/bin/lein-pkg /usr/local/bin/lein && \
@@ -27,7 +33,8 @@ RUN apt-get update && \
    wget --quiet \
        https://github.com/technomancy/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.zip \
        -O /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
    rm -rf rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY ./ /benchmark
WORKDIR /benchmark
RUN make
+0 −0

File moved.

+11 −4
Original line number Diff line number Diff line
.PHONY: all test clean c clojure
ROUNDS = 100000
ROUNDS ?= 100000

all: c clojure
.PHONY: all
all: c clojure go

.PHONY: c
c: a.out

.PHONY: clojure
clojure: target/uberjar

target/uberjar:
@@ -13,10 +16,14 @@ target/uberjar:
a.out:
	gcc --std=c99 -Wall -lm -O3 prime.c

.PHONY: clean
clean:
	- rm -fr a.out __pycache__
	cd prime.clj; lein clean
	git clean -fdX

go: prime.go
	go build -o go prime.go

.PHONY: all
test: all
	@ time -f "%C : %E seconds" ./a.out $(ROUNDS) > /dev/null
	@ time -f "%C : %E seconds" java -jar prime.clj/target/uberjar/*-standalone.jar $(ROUNDS) > /dev/null
+11 −2
Original line number Diff line number Diff line
@@ -21,22 +21,25 @@ Added languages
Usage
-----
Build:

.. code:: shell

    make

Clean:

.. code:: shell

    make clean

Test:

.. code:: shell

    make test

Also, Docker and Docker Compose are supported (so just run :code:
`docker-compose up`).
Also, Docker and Docker Compose are supported (so just run
:code:`docker-compose up`).

History
-------
@@ -46,3 +49,9 @@ structure. But I had difficulties expressing what I wanted so I first wrote the
program in Python. After I had the program written in both languages I did the
obvious thing, I timed them. From there on Barak implemented the program in PHP
and we implemented it in C. We hope to have many more languages tested.

License
-------

This software is licensed under the BSD 3-clause license (see the
:code:`LICENSE.txt` file).
Loading