-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add
benches_{tokio,vs_actix-web}
& add [profile.release]
c…
…onfig to `benches_*` (#254) * add `benches_{tokio,vs_actix-web}` & add `[profile.release]` to benches * refactor directory structure
- Loading branch information
Showing
14 changed files
with
125 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,16 @@ authors = ["kanarus <[email protected]>"] | |
|
||
[dependencies] | ||
# set `default-features = false` to assure "DEBUG" feature be off even when DEBUGing `../ohkami` | ||
ohkami = { path = "../ohkami", default-features = false, features = ["rt_glommio"] } | ||
ohkami = { path = "../../ohkami", default-features = false, features = ["rt_glommio"] } | ||
glommio = { version = "0.9" } | ||
|
||
[profile.release] | ||
opt-level = 3 | ||
debug = false | ||
debug-assertions = false | ||
lto = true | ||
panic = "abort" | ||
incremental = false | ||
codegen-units = 1 | ||
rpath = false | ||
strip = false |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,16 @@ authors = ["kanarus <[email protected]>"] | |
|
||
[dependencies] | ||
# set `default-features = false` to assure "DEBUG" feature be off even when DEBUGing `../ohkami` | ||
ohkami = { path = "../ohkami", default-features = false, features = ["rt_smol"] } | ||
ohkami = { path = "../../ohkami", default-features = false, features = ["rt_smol"] } | ||
smol = { version = "2" } | ||
|
||
[profile.release] | ||
opt-level = 3 | ||
debug = false | ||
debug-assertions = false | ||
lto = true | ||
panic = "abort" | ||
incremental = false | ||
codegen-units = 1 | ||
rpath = false | ||
strip = false |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "ohkami_benches-with-tokio" | ||
version = "0.0.0" | ||
edition = "2021" | ||
authors = ["kanarus <[email protected]>"] | ||
|
||
[dependencies] | ||
# set `default-features = false` to assure "DEBUG" feature be off even when DEBUGing `../ohkami` | ||
ohkami = { path = "../../ohkami", default-features = false, features = ["rt_tokio"] } | ||
tokio = { version = "1", features = ["full"] } | ||
|
||
[profile.release] | ||
opt-level = 3 | ||
debug = false | ||
debug-assertions = false | ||
lto = true | ||
panic = "abort" | ||
incremental = false | ||
codegen-units = 1 | ||
rpath = false | ||
strip = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use ohkami::prelude::*; | ||
use ohkami::format::JSON; | ||
|
||
#[derive(Serialize)] | ||
struct Message { | ||
message: String | ||
} | ||
|
||
async fn hello(name: &str) -> JSON<Message> { | ||
JSON(Message { | ||
message: format!("Hello, {name}!") | ||
}) | ||
} | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
Ohkami::new(( | ||
"/hello/:name".GET(hello), | ||
)).howl("localhost:3000").await | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "ohkami_benches_vs_actix-web" | ||
version = "0.0.0" | ||
edition = "2021" | ||
authors = ["kanarus <[email protected]>"] | ||
|
||
[dependencies] | ||
actix-web = { version = "4" } | ||
|
||
[profile.release] | ||
opt-level = 3 | ||
debug = false | ||
debug-assertions = false | ||
lto = true | ||
panic = "abort" | ||
incremental = false | ||
codegen-units = 1 | ||
rpath = false | ||
strip = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use actix_web::{get, web, App, HttpServer}; | ||
|
||
#[get("/user/{id}")] | ||
async fn echo(id: web::Path<String>) -> String { | ||
id.into_inner() | ||
} | ||
|
||
#[actix_web::main] | ||
async fn main() -> std::io::Result<()> { | ||
HttpServer::new(|| { | ||
App::new() | ||
.service(echo) | ||
}) | ||
.bind("0.0.0.0:3000")? | ||
.run().await | ||
} |