Browse Source

Lithium: benchmark clang vs gcc (#5911)

* Lithium: benchmark clang vs gcc

* Lithium: re-run travis.

* Lithium: re-run travis.
Matthieu Garrigues 5 years ago
parent
commit
ead55b0e33

+ 24 - 0
frameworks/C++/lithium/benchmark_config.json

@@ -371,6 +371,30 @@
         "notes": "",
         "versus": "None"
       },
+      "postgres-5-clang": {
+        "json_url"       : "/json",
+        "db_url"         : "/db",
+        "query_url"      : "/queries?N=",
+        "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
+        "plaintext_url"  : "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "Lithium",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "Lithium-postgres-5-clang",
+        "notes": "clang with pgo",
+        "versus": "None"
+      },
+      
       "postgres-6": {
         "json_url"       : "/json",
         "db_url"         : "/db",

+ 4 - 3
frameworks/C++/lithium/compile_and_start_clang.sh

@@ -1,7 +1,8 @@
 #! /bin/sh
 
 DB_FLAG=$1
-COMMIT=ba3849b86e004798faf91d64a1a9550e379ac53a
+N_SQL_CONNECTIONS=$2
+COMMIT=2ea53ab949627baeaaad77e7662da74f9a9d0a31
 
 if [ $DB_FLAG = "TFB_MYSQL" ]; then
   CXX_FLAGS="-I /usr/include/mariadb  -lmariadbclient "
@@ -14,9 +15,9 @@ fi
 
 wget https://raw.githubusercontent.com/matt-42/lithium/$COMMIT/single_headers/lithium_http_backend.hh
 
-clang++ -fprofile-instr-generate=./profile.prof -flto -DPROFILE_MODE -DNDEBUG -D$DB_FLAG -O3 -march=native -std=c++17 ./lithium.cc $CXX_FLAGS -lpthread -lboost_context -lssl -lcrypto -o /lithium_tbf
+clang++ -fprofile-instr-generate=./profile.prof -flto -DN_SQL_CONNECTIONS=$N_SQL_CONNECTIONS -DPROFILE_MODE -DNDEBUG -D$DB_FLAG -O3 -march=native -std=c++17 ./lithium.cc $CXX_FLAGS -lpthread -lboost_context -lssl -lcrypto -o /lithium_tbf
 /lithium_tbf tfb-database 8081
 llvm-profdata-10 merge -output=./profile.pgo  ./profile.prof
-clang++ -fprofile-instr-use=./profile.pgo -flto -DNDEBUG -D$DB_FLAG -O3 -march=native -std=c++17 ./lithium.cc $CXX_FLAGS -lpthread -lboost_context -lssl -lcrypto -o /lithium_tbf
+clang++ -fprofile-instr-use=./profile.pgo -flto -DN_SQL_CONNECTIONS=$N_SQL_CONNECTIONS -DNDEBUG -D$DB_FLAG -O3 -march=native -std=c++17 ./lithium.cc $CXX_FLAGS -lpthread -lboost_context -lssl -lcrypto -o /lithium_tbf
 
 /lithium_tbf tfb-database 8080

+ 8 - 0
frameworks/C++/lithium/lithium-postgres-5-clang.dockerfile

@@ -0,0 +1,8 @@
+FROM buildpack-deps:focal
+
+RUN apt-get update -yqq
+RUN apt-get install -yqq clang libboost-dev postgresql-server-dev-all libpq-dev wget libboost-context-dev
+
+COPY ./ ./
+
+CMD ./compile_and_start_clang.sh TFB_PGSQL 5