diff --git a/frameworks/C++/userver/README.md b/frameworks/C++/userver/README.md index d10de17e403..8b1d83c4d2a 100755 --- a/frameworks/C++/userver/README.md +++ b/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 diff --git a/frameworks/C++/userver/benchmark_config.json b/frameworks/C++/userver/benchmark_config.json index aba5e7d5933..8a455b99a30 100755 --- a/frameworks/C++/userver/benchmark_config.json +++ b/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" } } ] diff --git a/frameworks/C++/userver/config.toml b/frameworks/C++/userver/config.toml index 316860f74a1..424fd5d6457 100644 --- a/frameworks/C++/userver/config.toml +++ b/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" diff --git a/frameworks/C++/userver/userver-bare.dockerfile b/frameworks/C++/userver/userver-bare.dockerfile deleted file mode 100644 index 92f8cdaa080..00000000000 --- a/frameworks/C++/userver/userver-bare.dockerfile +++ /dev/null @@ -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 - diff --git a/frameworks/C++/userver/userver.dockerfile b/frameworks/C++/userver/userver.dockerfile index 5f4755e3714..e115816b324 100644 --- a/frameworks/C++/userver/userver.dockerfile +++ b/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) diff --git a/frameworks/C++/userver/userver_benchmark/userver_techempower.cpp b/frameworks/C++/userver/userver_benchmark/userver_techempower.cpp index 6e994d3021c..af0a2b64842 100644 --- a/frameworks/C++/userver/userver_benchmark/userver_techempower.cpp +++ b/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() // cache component .Append() .Append() - // tracing and metrics tweaks + // tracing tweaks .Append() - .Append() - // bare + // bare (not used in the benchmark currently) .Append() .Append(); diff --git a/frameworks/C++/userver/userver_configs/static_config.yaml b/frameworks/C++/userver/userver_configs/static_config.yaml index 4d7a7878912..ed793a694a7 100644 --- a/frameworks/C++/userver/userver_configs/static_config.yaml +++ b/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