Update benchmark
This commit is contained in:
parent
a79c56d06b
commit
7b18ae6f16
3
.gitignore
vendored
3
.gitignore
vendored
@ -24,8 +24,7 @@ test/*.o
|
|||||||
test/*.pem
|
test/*.pem
|
||||||
test/*.srl
|
test/*.srl
|
||||||
work/
|
work/
|
||||||
benchmark/server
|
benchmark/server*
|
||||||
benchmark/server-crow
|
|
||||||
|
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
|
@ -2,12 +2,14 @@ CXXFLAGS = -std=c++11 -O2 -I..
|
|||||||
|
|
||||||
THEAD_POOL_COUNT = 16
|
THEAD_POOL_COUNT = 16
|
||||||
|
|
||||||
BENCH = bombardier -l -c 10 -d 5s localhost:8080
|
BENCH = bombardier -c 10 -d 5s localhost:8080
|
||||||
MONITOR = ali http://localhost:8080
|
MONITOR = ali http://localhost:8080
|
||||||
|
|
||||||
# cpp-httplib
|
# cpp-httplib
|
||||||
bench: server
|
bench: server
|
||||||
|
@echo "--------------------\n cpp-httplib latest\n--------------------\n"
|
||||||
@./server & export PID=$$!; $(BENCH); kill $${PID}
|
@./server & export PID=$$!; $(BENCH); kill $${PID}
|
||||||
|
@echo ""
|
||||||
|
|
||||||
monitor: server
|
monitor: server
|
||||||
@./server & export PID=$$!; $(MONITOR); kill $${PID}
|
@./server & export PID=$$!; $(MONITOR); kill $${PID}
|
||||||
@ -18,9 +20,26 @@ run : server
|
|||||||
server : cpp-httplib/main.cpp ../httplib.h
|
server : cpp-httplib/main.cpp ../httplib.h
|
||||||
g++ -o $@ $(CXXFLAGS) -DCPPHTTPLIB_THREAD_POOL_COUNT=$(THEAD_POOL_COUNT) cpp-httplib/main.cpp
|
g++ -o $@ $(CXXFLAGS) -DCPPHTTPLIB_THREAD_POOL_COUNT=$(THEAD_POOL_COUNT) cpp-httplib/main.cpp
|
||||||
|
|
||||||
|
# cpp-httplib
|
||||||
|
bench-base: server-base
|
||||||
|
@echo "---------------------\n cpp-httplib v0.17.0\n---------------------\n"
|
||||||
|
@./server-base & export PID=$$!; $(BENCH); kill $${PID}
|
||||||
|
@echo ""
|
||||||
|
|
||||||
|
monitor-base: server-base
|
||||||
|
@./server-base & export PID=$$!; $(MONITOR); kill $${PID}
|
||||||
|
|
||||||
|
run-base : server-base
|
||||||
|
@./server-base
|
||||||
|
|
||||||
|
server-base : cpp-httplib-base/main.cpp cpp-httplib-base/httplib.h
|
||||||
|
g++ -o $@ $(CXXFLAGS) -DCPPHTTPLIB_THREAD_POOL_COUNT=$(THEAD_POOL_COUNT) cpp-httplib-base/main.cpp
|
||||||
|
|
||||||
# crow
|
# crow
|
||||||
bench-crow: server-crow
|
bench-crow: server-crow
|
||||||
|
@echo "-------------\n Crow v1.2.0\n-------------\n"
|
||||||
@./server-crow & export PID=$$!; $(BENCH); kill $${PID}
|
@./server-crow & export PID=$$!; $(BENCH); kill $${PID}
|
||||||
|
@echo ""
|
||||||
|
|
||||||
monitor-crow: server-crow
|
monitor-crow: server-crow
|
||||||
@./server-crow & export PID=$$!; $(MONITOR); kill $${PID}
|
@./server-crow & export PID=$$!; $(MONITOR); kill $${PID}
|
||||||
@ -32,7 +51,7 @@ server-crow : crow/main.cpp
|
|||||||
g++ -o $@ $(CXXFLAGS) crow/main.cpp
|
g++ -o $@ $(CXXFLAGS) crow/main.cpp
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
bench-all: bench-crow bench
|
bench-all: bench-crow bench bench-base
|
||||||
|
|
||||||
issue:
|
issue:
|
||||||
$(BENCH)
|
$(BENCH)
|
||||||
|
9955
benchmark/cpp-httplib-base/httplib.h
Normal file
9955
benchmark/cpp-httplib-base/httplib.h
Normal file
File diff suppressed because it is too large
Load Diff
12
benchmark/cpp-httplib-base/main.cpp
Normal file
12
benchmark/cpp-httplib-base/main.cpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#include "./httplib.h"
|
||||||
|
using namespace httplib;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
Server svr;
|
||||||
|
|
||||||
|
svr.Get("/", [](const Request &, Response &res) {
|
||||||
|
res.set_content("Hello World!", "text/plain");
|
||||||
|
});
|
||||||
|
|
||||||
|
svr.listen("0.0.0.0", 8080);
|
||||||
|
}
|
2
benchmark/download.sh
Executable file
2
benchmark/download.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
rm -f httplib.h
|
||||||
|
wget https://raw.githubusercontent.com/yhirose/cpp-httplib/v$1/httplib.h
|
Loading…
x
Reference in New Issue
Block a user