Skip to content

Commit 2ae467e

Browse files
committed
2 parents 30c9830 + db30328 commit 2ae467e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+222
-464
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

frameworks/Elixir/phoenix/config/prod.exs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ import Config
22

33
config :hello, HelloWeb.Endpoint,
44
adapter: Bandit.PhoenixAdapter,
5-
http: [port: 8080, ip: {0, 0, 0, 0}],
6-
http_options: [log_protocol_errors: false],
5+
http: [
6+
port: 8080,
7+
ip: {0, 0, 0, 0},
8+
http_options: [
9+
compress: false,
10+
log_protocol_errors: false
11+
]
12+
],
713
compress: false,
814
check_origin: false,
915
debug_errors: false,

frameworks/Elixir/phoenix/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ defmodule Hello.Mixfile do
2929
# Type `mix help deps` for examples and options
3030
defp deps do
3131
[
32-
{:bandit, "~> 1.0.0"},
32+
{:bandit, "1.5.7"},
3333
{:gettext, "~> 0.20"},
3434
{:ecto_sql, "~> 3.10"},
3535
{:jason, "~> 1.2"},

frameworks/Elixir/phoenix/mix.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
%{
2-
"bandit": {:hex, :bandit, "1.0.0", "2bd87bbf713d0eed0090f2fa162cd1676198122e6c2b68a201c706e354a6d5e5", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "32acf6ac030fee1f99fd9c3fcf81671911ae8637e0a61c98111861b466efafdb"},
2+
"bandit": {:hex, :bandit, "1.5.7", "6856b1e1df4f2b0cb3df1377eab7891bec2da6a7fd69dc78594ad3e152363a50", [:mix], [{:hpax, "~> 1.0.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "f2dd92ae87d2cbea2fa9aa1652db157b6cba6c405cb44d4f6dd87abba41371cd"},
33
"castore": {:hex, :castore, "1.0.8", "dedcf20ea746694647f883590b82d9e96014057aff1d44d03ec90f36a5c0dc6e", [:mix], [], "hexpm", "0b2b66d2ee742cb1d9cb8c8be3b43c3a70ee8651f37b75a8b982e036752983f1"},
44
"cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"},
55
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
@@ -10,7 +10,7 @@
1010
"ecto_sql": {:hex, :ecto_sql, "3.11.3", "4eb7348ff8101fbc4e6bbc5a4404a24fecbe73a3372d16569526b0cf34ebc195", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e5f36e3d736b99c7fee3e631333b8394ade4bafe9d96d35669fca2d81c2be928"},
1111
"expo": {:hex, :expo, "1.0.0", "647639267e088717232f4d4451526e7a9de31a3402af7fcbda09b27e9a10395a", [:mix], [], "hexpm", "18d2093d344d97678e8a331ca0391e85d29816f9664a25653fd7e6166827827c"},
1212
"gettext": {:hex, :gettext, "0.25.0", "98a95a862a94e2d55d24520dd79256a15c87ea75b49673a2e2f206e6ebc42e5d", [:mix], [{:expo, "~> 0.5.1 or ~> 1.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "38e5d754e66af37980a94fb93bb20dcde1d2361f664b0a19f01e87296634051f"},
13-
"hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
13+
"hpax": {:hex, :hpax, "1.0.0", "28dcf54509fe2152a3d040e4e3df5b265dcb6cb532029ecbacf4ce52caea3fd2", [:mix], [], "hexpm", "7f1314731d711e2ca5fdc7fd361296593fc2542570b3105595bb0bc6d0fad601"},
1414
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
1515
"mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},
1616
"nebulex": {:hex, :nebulex, "2.6.3", "78af348ed9f8a338871b41e0b6de718c1808e627ce03fbe86598cbda2bdda2f5", [:mix], [{:decorator, "~> 1.4", [hex: :decorator, repo: "hexpm", optional: true]}, {:shards, "~> 1.1", [hex: :shards, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "09cdcbb62f8463ffcec7cae4936425ce91e25d92a6cd37e48b5dda7c851958d5"},
@@ -25,7 +25,7 @@
2525
"plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"},
2626
"postgrex": {:hex, :postgrex, "0.19.0", "f7d50e50cb42e0a185f5b9a6095125a9ab7e4abccfbe2ab820ab9aa92b71dbab", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "dba2d2a0a8637defbf2307e8629cb2526388ba7348f67d04ec77a5d6a72ecfae"},
2727
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
28-
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
28+
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
2929
"thousand_island": {:hex, :thousand_island, "1.3.5", "6022b6338f1635b3d32406ff98d68b843ba73b3aa95cfc27154223244f3a6ca5", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2be6954916fdfe4756af3239fb6b6d75d0b8063b5df03ba76fd8a4c87849e180"},
3030
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
3131
"websock_adapter": {:hex, :websock_adapter, "0.5.6", "0437fe56e093fd4ac422de33bf8fc89f7bc1416a3f2d732d8b2c8fd54792fe60", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "e04378d26b0af627817ae84c92083b7e97aca3121196679b73c73b99d0d133ea"},

0 commit comments

Comments
 (0)