-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use all cpu cores by default The previous setup only used every other core * Update ubuntu and gcc * Copy sources at the end to avoid rebuilding cached docker layers Also remove unecessary call to "make clean" * Use multi-stage docker build for a much smaller final image * Update to the latest version libreactor And use reactor_server abstraction * Set CFLAGS to enable gcc -O3 optimization Also set warning flags * Update README * Remove "broken" tag
- Loading branch information
1 parent
9001e48
commit 4ebc75c
Showing
7 changed files
with
104 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
CC = gcc-6 | ||
PROG = libreactor | ||
OBJS = src/setup.o src/main.o | ||
CFLAGS = -std=gnu11 -Wall -O3 -march=native -mtune=native -flto -fuse-linker-plugin -Isrc | ||
LDADD = -lreactor -ldynamic -lclo | ||
PROG = libreactor | ||
OBJS = src/setup.o src/main.o | ||
CFLAGS = -std=gnu11 -Wall -Wextra -Wpedantic -O3 | ||
LDFLAGS = -pthread | ||
LDADD = -lreactor -ldynamic -lclo -flto | ||
|
||
$(PROG): $(OBJS) | ||
$(CC) -o $@ $^ $(CFLAGS) $(LDADD) | ||
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDADD) | ||
|
||
clean: | ||
rm -f $(PROG) $(OBJS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
# libreactor | ||
# libreactor Benchmarking Test | ||
|
||
Benchmarks for the [libreactor](https://github.com/fredrikwidlund/libreactor) library. | ||
### Test Type Implementation Source Code | ||
|
||
* [JSON](src/main.c) | ||
* [PLAINTEXT](src/main.c) | ||
|
||
|
||
## Important Libraries | ||
* [libreactor](https://github.com/fredrikwidlund/libreactor) | ||
* [libclo](https://github.com/fredrikwidlund/libclo/) | ||
* [libdynamic](https://github.com/fredrikwidlund/libdynamic/) | ||
|
||
## Test URLs | ||
### JSON | ||
|
||
http://localhost:8080/json | ||
|
||
### PLAINTEXT | ||
|
||
http://localhost:8080/plaintext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,46 @@ | ||
FROM ubuntu:16.04 | ||
FROM ubuntu:18.04 as builder | ||
|
||
RUN apt-get update -yqq | ||
RUN apt-get install -yqq software-properties-common python-software-properties wget make | ||
RUN apt-get install -yqq wget make automake libtool file gcc-8 g++-8 | ||
|
||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ | ||
apt-get update -yqq && \ | ||
apt-get install -yqq gcc-6 g++-6 | ||
|
||
ADD ./ /libreactor | ||
WORKDIR /libreactor | ||
|
||
RUN wget -q https://github.com/fredrikwidlund/libdynamic/releases/download/v1.1.0/libdynamic-1.1.0.tar.gz && \ | ||
tar xfz libdynamic-1.1.0.tar.gz && \ | ||
cd libdynamic-1.1.0 && \ | ||
./configure CC=gcc-6 AR=gcc-ar-6 NM=gcc-nm-6 RANLIB=gcc-ranlib-6 && \ | ||
make && make install | ||
ENV CC=gcc-8 AR=gcc-ar-8 NM=gcc-nm-8 RANLIB=gcc-ranlib-8 | ||
|
||
RUN wget -q https://github.com/akheron/jansson/archive/v2.12.tar.gz -O jansson-2.12.tar.gz && \ | ||
tar xfz jansson-2.12.tar.gz && \ | ||
cd jansson-2.12 && \ | ||
autoreconf -fi && \ | ||
./configure && \ | ||
make install | ||
|
||
RUN wget -q https://github.com/fredrikwidlund/libdynamic/releases/download/v1.3.0/libdynamic-1.3.0.tar.gz && \ | ||
tar xfz libdynamic-1.3.0.tar.gz && \ | ||
cd libdynamic-1.3.0 && \ | ||
./configure --prefix=/usr && \ | ||
make install | ||
|
||
RUN wget -q https://github.com/fredrikwidlund/libclo/releases/download/v1.0.0/libclo-1.0.0.tar.gz && \ | ||
tar xfz libclo-1.0.0.tar.gz && \ | ||
cd libclo-1.0.0 && \ | ||
./configure && \ | ||
make install | ||
|
||
RUN wget -q https://github.com/fredrikwidlund/libreactor/releases/download/v1.0.0/libreactor-1.0.0.tar.gz && \ | ||
tar xfz libreactor-1.0.0.tar.gz && \ | ||
cd libreactor-1.0.0 && \ | ||
./configure CC=gcc-6 AR=gcc-ar-6 NM=gcc-nm-6 RANLIB=gcc-ranlib-6 && \ | ||
make && make install | ||
RUN wget -q https://github.com/fredrikwidlund/libreactor/releases/download/v1.0.1/libreactor-1.0.1.tar.gz && \ | ||
tar xfz libreactor-1.0.1.tar.gz && \ | ||
cd libreactor-1.0.1 && \ | ||
./configure --prefix=/usr CFLAGS="-Wall -Wextra -Wpedantic -O3" && \ | ||
make install | ||
|
||
RUN wget -q https://github.com/fredrikwidlund/libclo/releases/download/v0.1.0/libclo-0.1.0.tar.gz && \ | ||
tar xfz libclo-0.1.0.tar.gz && \ | ||
cd libclo-0.1.0 && \ | ||
./configure CC=gcc-6 AR=gcc-ar-6 NM=gcc-nm-6 RANLIB=gcc-ranlib-6 && \ | ||
make && make install | ||
COPY src/ /libreactor/src/ | ||
COPY Makefile /libreactor/Makefile | ||
|
||
RUN make clean && make | ||
RUN make | ||
|
||
|
||
FROM ubuntu:18.04 | ||
|
||
WORKDIR /libreactor | ||
COPY --from=builder /libreactor . | ||
|
||
CMD ["./libreactor"] | ||
CMD ["./libreactor"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef SETUP_H_INCLUDED | ||
#define SETUP_H_INCLUDED | ||
|
||
void setup(size_t, int); | ||
void setup(); | ||
|
||
#endif /* SETUP_H_INCLUDED */ |