Browse Source

[C++] [userver] Remove way too unrealistic "bare" configuration (#9267)

* drop bare-configuration from the suite

* cleanup README

* drop LTO, as userver doesn't support it

* remove unrealistic tweaks
itrofimow 10 months ago
parent
commit
55a16e9753

+ 5 - 4
frameworks/C++/userver/README.md

@@ -2,14 +2,11 @@
 
 This is the [userver](https://github.com/userver-framework/userver) portion of a [benchmarking test suite](https://github.com/TechEmpower/FrameworkBenchmarks) comparing a variety of web development platforms.
 
-This benchmarks comes in two configurations: **userver** and **userver-bare**, where both configurations use exactly the same handlers code, but **userver-bare** replaces default http implementation of **userver** with custom one.  
-You see, **userver** being feature-rich framework widely used in production comes with a lot of useful functionality built-in (metrics, dynamic configuring, logging/tracing, congestion control etc...) none of which is of any use in benchmarks; although most of that can be disabled via configs, some parts remain, and these parts aren't free.  
-The aim of **userver-bare** is to explore practical limits of lower-level **userver** functionality when performance is an absolute must, while still being idiomatic userver code.
-
 ### Test Type Implementation Source Code
 
 * [Plaintext](userver_benchmark/controllers/plaintext/handler.cpp)
 * [Json](userver_benchmark/controllers/json/handler.cpp)
+* [Fortunes](userver_benchmark/controllers/fortunes/handler.cpp)
 * [Single Database Query](userver_benchmark/controllers/single_query/handler.cpp)
 * [Multiple Database Queries](userver_benchmark/controllers/multiple_queries/handler.cpp)
 * [Database Updates](userver_benchmark/controllers/updates/handler.cpp)
@@ -24,6 +21,10 @@ http://localhost:8080/plaintext
 
 http://localhost:8080/json
 
+### Fortunes
+
+http://localhost:8080/fortunes
+
 ### Single Database Query
 
 http://localhost:8080/db

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

@@ -25,30 +25,6 @@
         "display_name": "userver",
         "notes": "",
         "versus": "None"
-      },
-      "bare": {
-        "json_url": "/json",
-        "plaintext_url": "/plaintext",
-        "db_url": "/db",
-        "query_url": "/queries?queries=",
-        "update_url": "/updates?queries=",
-        "cached_query_url": "/cached-queries?count=",
-	"fortune_url": "/fortunes",
-        "port": 8081,
-        "approach": "Realistic",
-        "classification": "Micro",
-        "database": "postgres",
-        "framework": "userver",
-        "language": "C++",
-        "flavor": "None",
-        "orm": "Micro",
-        "platform": "None",
-        "webserver": "None",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "userver[bare]",
-        "notes": "",
-        "versus": "None"
       }
     }
   ]

+ 0 - 18
frameworks/C++/userver/config.toml

@@ -18,21 +18,3 @@ orm = "Micro"
 platform = "None"
 webserver = "None"
 versus = "None"
-
-[bare]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/updates?queries="
-urls.cached_query = "/cached-queries?count="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Micro"
-database = "Postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "None"
-versus = "None"

+ 0 - 29
frameworks/C++/userver/userver-bare.dockerfile

@@ -1,29 +0,0 @@
-FROM ghcr.io/userver-framework/ubuntu-22.04-userver-pg AS builder
-
-RUN apt update && \
-    apt install -y lsb-release wget software-properties-common gnupg && \
-        wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16
-
-WORKDIR /src
-RUN git clone https://github.com/userver-framework/userver.git && \
-    cd userver && git checkout bdd5e1e03921ff378b062f86a189c3cfa3d66332
-
-COPY userver_benchmark/ ./
-RUN mkdir build && cd build && \
-    cmake -DUSERVER_IS_THE_ROOT_PROJECT=0 -DUSERVER_FEATURE_CRYPTOPP_BLAKE2=0 \
-          -DUSERVER_FEATURE_UTEST=0 \
-          -DUSERVER_FEATURE_POSTGRESQL=1 \
-          -DUSERVER_FEATURE_ERASE_LOG_WITH_LEVEL=warning \
-          -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native -flto=thin" -DCMAKE_C_FLAGS="-march=native -flto=thin" \
-          -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16 -DUSERVER_USE_LD=lld-16 \
-          -DUSERVER_LTO=0 .. && \
-    make -j $(nproc)
-
-FROM builder AS runner
-WORKDIR /app
-COPY userver_configs/* ./
-COPY --from=builder /src/build/userver_techempower ./
-
-EXPOSE 8081
-CMD ./userver_techempower -c ./static_config.yaml
-

+ 1 - 1
frameworks/C++/userver/userver.dockerfile

@@ -14,7 +14,7 @@ RUN mkdir build && cd build && \
           -DUSERVER_FEATURE_UTEST=0 \
           -DUSERVER_FEATURE_POSTGRESQL=1 \
           -DUSERVER_FEATURE_ERASE_LOG_WITH_LEVEL=warning \
-          -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native -flto=thin" -DCMAKE_C_FLAGS="-march=native -flto=thin" \
+          -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native" -DCMAKE_C_FLAGS="-march=native" \
           -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16 -DUSERVER_USE_LD=lld-16 \
           -DUSERVER_LTO=0 .. && \
     make -j $(nproc)

+ 2 - 17
frameworks/C++/userver/userver_benchmark/userver_techempower.cpp

@@ -46,20 +46,6 @@ class NoopTracingManager final
       userver::server::http::HttpResponse&) const final {}
 };
 
-class MinimalMiddlewarePipelineBuilder final
-    : public userver::server::middlewares::PipelineBuilder {
- public:
-  static constexpr std::string_view kName{
-      "minimal-middleware-pipeline-builder"};
-  using userver::server::middlewares::PipelineBuilder::PipelineBuilder;
-
- private:
-  userver::server::middlewares::MiddlewaresList BuildPipeline(
-      userver::server::middlewares::MiddlewaresList) const override {
-    return {"userver-unknown-exceptions-handling-middleware"};
-  }
-};
-
 int Main(int argc, char* argv[]) {
   auto component_list =
       userver::components::MinimalServerComponentList()
@@ -78,10 +64,9 @@ int Main(int argc, char* argv[]) {
           .Append<cached_queries::WorldCacheComponent>()  // cache component
           .Append<cached_queries::Handler>()
           .Append<fortunes::Handler>()
-          // tracing and metrics tweaks
+          // tracing tweaks
           .Append<NoopTracingManager>()
-          .Append<MinimalMiddlewarePipelineBuilder>()
-          // bare
+          // bare (not used in the benchmark currently)
           .Append<bare::SimpleRouter>()
           .Append<bare::SimpleServer>();
 

+ 0 - 3
frameworks/C++/userver/userver_configs/static_config.yaml

@@ -13,7 +13,6 @@ components_manager:
             thread_name: main-worker    # OS will show the threads of this task processor with 'main-worker' prefix.
             worker_threads: 48
             guess-cpu-limit: true
-            task-processor-queue: work-stealing-task-queue
 
         fs-task-processor:              # Make a separate task processor for filesystem bound tasks.
             thread_name: fs-worker
@@ -29,7 +28,6 @@ components_manager:
                 handler-defaults:
                     set_tracing_headers: false
             server-name: us
-            middleware-pipeline-builder: minimal-middleware-pipeline-builder
         simple-router:
         simple-server:
             port: 8081
@@ -63,7 +61,6 @@ components_manager:
         noop-tracing-manager:
         tracing-manager-locator:
             component-name: noop-tracing-manager
-        minimal-middleware-pipeline-builder:
 
         plaintext-handler:
             path: /plaintext