Skip to content

Commit 55a16e9

Browse files
authored
[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
1 parent 3d85c25 commit 55a16e9

File tree

7 files changed

+8
-96
lines changed

7 files changed

+8
-96
lines changed

frameworks/C++/userver/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22

33
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.
44

5-
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.
6-
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.
7-
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.
8-
95
### Test Type Implementation Source Code
106

117
* [Plaintext](userver_benchmark/controllers/plaintext/handler.cpp)
128
* [Json](userver_benchmark/controllers/json/handler.cpp)
9+
* [Fortunes](userver_benchmark/controllers/fortunes/handler.cpp)
1310
* [Single Database Query](userver_benchmark/controllers/single_query/handler.cpp)
1411
* [Multiple Database Queries](userver_benchmark/controllers/multiple_queries/handler.cpp)
1512
* [Database Updates](userver_benchmark/controllers/updates/handler.cpp)
@@ -24,6 +21,10 @@ http://localhost:8080/plaintext
2421

2522
http://localhost:8080/json
2623

24+
### Fortunes
25+
26+
http://localhost:8080/fortunes
27+
2728
### Single Database Query
2829

2930
http://localhost:8080/db

frameworks/C++/userver/benchmark_config.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,6 @@
2525
"display_name": "userver",
2626
"notes": "",
2727
"versus": "None"
28-
},
29-
"bare": {
30-
"json_url": "/json",
31-
"plaintext_url": "/plaintext",
32-
"db_url": "/db",
33-
"query_url": "/queries?queries=",
34-
"update_url": "/updates?queries=",
35-
"cached_query_url": "/cached-queries?count=",
36-
"fortune_url": "/fortunes",
37-
"port": 8081,
38-
"approach": "Realistic",
39-
"classification": "Micro",
40-
"database": "postgres",
41-
"framework": "userver",
42-
"language": "C++",
43-
"flavor": "None",
44-
"orm": "Micro",
45-
"platform": "None",
46-
"webserver": "None",
47-
"os": "Linux",
48-
"database_os": "Linux",
49-
"display_name": "userver[bare]",
50-
"notes": "",
51-
"versus": "None"
5228
}
5329
}
5430
]

frameworks/C++/userver/config.toml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,3 @@ orm = "Micro"
1818
platform = "None"
1919
webserver = "None"
2020
versus = "None"
21-
22-
[bare]
23-
urls.plaintext = "/plaintext"
24-
urls.json = "/json"
25-
urls.db = "/db"
26-
urls.query = "/queries?queries="
27-
urls.update = "/updates?queries="
28-
urls.cached_query = "/cached-queries?count="
29-
urls.fortune = "/fortunes"
30-
approach = "Realistic"
31-
classification = "Micro"
32-
database = "Postgres"
33-
database_os = "Linux"
34-
os = "Linux"
35-
orm = "Micro"
36-
platform = "None"
37-
webserver = "None"
38-
versus = "None"

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

frameworks/C++/userver/userver.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN mkdir build && cd build && \
1414
-DUSERVER_FEATURE_UTEST=0 \
1515
-DUSERVER_FEATURE_POSTGRESQL=1 \
1616
-DUSERVER_FEATURE_ERASE_LOG_WITH_LEVEL=warning \
17-
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native -flto=thin" -DCMAKE_C_FLAGS="-march=native -flto=thin" \
17+
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native" -DCMAKE_C_FLAGS="-march=native" \
1818
-DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16 -DUSERVER_USE_LD=lld-16 \
1919
-DUSERVER_LTO=0 .. && \
2020
make -j $(nproc)

frameworks/C++/userver/userver_benchmark/userver_techempower.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,6 @@ class NoopTracingManager final
4646
userver::server::http::HttpResponse&) const final {}
4747
};
4848

49-
class MinimalMiddlewarePipelineBuilder final
50-
: public userver::server::middlewares::PipelineBuilder {
51-
public:
52-
static constexpr std::string_view kName{
53-
"minimal-middleware-pipeline-builder"};
54-
using userver::server::middlewares::PipelineBuilder::PipelineBuilder;
55-
56-
private:
57-
userver::server::middlewares::MiddlewaresList BuildPipeline(
58-
userver::server::middlewares::MiddlewaresList) const override {
59-
return {"userver-unknown-exceptions-handling-middleware"};
60-
}
61-
};
62-
6349
int Main(int argc, char* argv[]) {
6450
auto component_list =
6551
userver::components::MinimalServerComponentList()
@@ -78,10 +64,9 @@ int Main(int argc, char* argv[]) {
7864
.Append<cached_queries::WorldCacheComponent>() // cache component
7965
.Append<cached_queries::Handler>()
8066
.Append<fortunes::Handler>()
81-
// tracing and metrics tweaks
67+
// tracing tweaks
8268
.Append<NoopTracingManager>()
83-
.Append<MinimalMiddlewarePipelineBuilder>()
84-
// bare
69+
// bare (not used in the benchmark currently)
8570
.Append<bare::SimpleRouter>()
8671
.Append<bare::SimpleServer>();
8772

frameworks/C++/userver/userver_configs/static_config.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ components_manager:
1313
thread_name: main-worker # OS will show the threads of this task processor with 'main-worker' prefix.
1414
worker_threads: 48
1515
guess-cpu-limit: true
16-
task-processor-queue: work-stealing-task-queue
1716

1817
fs-task-processor: # Make a separate task processor for filesystem bound tasks.
1918
thread_name: fs-worker
@@ -29,7 +28,6 @@ components_manager:
2928
handler-defaults:
3029
set_tracing_headers: false
3130
server-name: us
32-
middleware-pipeline-builder: minimal-middleware-pipeline-builder
3331
simple-router:
3432
simple-server:
3533
port: 8081
@@ -63,7 +61,6 @@ components_manager:
6361
noop-tracing-manager:
6462
tracing-manager-locator:
6563
component-name: noop-tracing-manager
66-
minimal-middleware-pipeline-builder:
6764

6865
plaintext-handler:
6966
path: /plaintext

0 commit comments

Comments
 (0)