Skip to content

Commit

Permalink
[C++] [userver] Remove way too unrealistic "bare" configuration (Tech…
Browse files Browse the repository at this point in the history
…Empower#9267)

* drop bare-configuration from the suite

* cleanup README

* drop LTO, as userver doesn't support it

* remove unrealistic tweaks
  • Loading branch information
itrofimow authored Sep 19, 2024
1 parent 3d85c25 commit 55a16e9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 96 deletions.
9 changes: 5 additions & 4 deletions frameworks/C++/userver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -24,6 +21,10 @@ http://localhost:8080/plaintext

http://localhost:8080/json

### Fortunes

http://localhost:8080/fortunes

### Single Database Query

http://localhost:8080/db
Expand Down
24 changes: 0 additions & 24 deletions frameworks/C++/userver/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
]
Expand Down
18 changes: 0 additions & 18 deletions frameworks/C++/userver/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
29 changes: 0 additions & 29 deletions frameworks/C++/userver/userver-bare.dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion frameworks/C++/userver/userver.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 2 additions & 17 deletions frameworks/C++/userver/userver_benchmark/userver_techempower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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>();

Expand Down
3 changes: 0 additions & 3 deletions frameworks/C++/userver/userver_configs/static_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 55a16e9

Please sign in to comment.