Skip to content

Commit c275c70

Browse files
committed
khttp: remove /plaintext benchmark, use mimalloc
1 parent 53e2e9d commit c275c70

File tree

5 files changed

+57
-42
lines changed

5 files changed

+57
-42
lines changed

frameworks/Rust/khttp/Cargo.lock

Lines changed: 53 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/Rust/khttp/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2024"
77
khttp = { version = "0.2", features = ["epoll"] }
88
yarte = { version = "0.15", features = ["json"] }
99
pq-sys = "0.7"
10+
mimalloc = "0.1"
1011

1112
[profile.release]
1213
opt-level = 3

frameworks/Rust/khttp/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Benchmark for [khttp](https://github.com/karlivory/khttp) - a low-level HTTP/1.1
55
### Test Type Implementation Source Code
66

77
* [JSON](./src/main.rs)
8-
* [PLAINTEXT](./src/main.rs)
98
* [FORTUNES](./src/main.rs)
109

1110
## Test URLs
@@ -14,10 +13,6 @@ Benchmark for [khttp](https://github.com/karlivory/khttp) - a low-level HTTP/1.1
1413

1514
http://localhost:8080/json
1615

17-
### PLAINTEXT
18-
19-
http://localhost:8080/plaintext
20-
2116
### FORTUNES
2217

2318
http://localhost:8080/fortunes

frameworks/Rust/khttp/benchmark_config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
{
55
"default": {
66
"json_url": "/json",
7-
"plaintext_url": "/plaintext",
87
"fortune_url": "/fortunes",
98
"port": 8080,
109
"approach": "Realistic",

frameworks/Rust/khttp/src/main.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#[global_allocator]
2+
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
3+
14
use khttp::{Headers, Method::*, RequestContext, ResponseHandle, Server, Status};
25
use std::{ffi::CStr, io, ptr};
36
use yarte::{Serialize, ywrite_html};
@@ -10,16 +13,6 @@ struct HelloMessage {
1013
fn main() {
1114
let mut app = Server::builder("0.0.0.0:8080").unwrap();
1215

13-
app.route(Get, "/plaintext", |_ctx, res| {
14-
// headers
15-
let mut headers = Headers::new();
16-
headers.add(Headers::CONTENT_TYPE, b"text/plain");
17-
headers.add("server", b"khttp");
18-
19-
// response
20-
res.ok(&headers, "Hello, World!")
21-
});
22-
2316
app.route(Get, "/json", |_ctx, res| {
2417
// headers
2518
let mut headers = Headers::new();

0 commit comments

Comments
 (0)