J'étais intéressé par les applications Web et Rust, j'ai donc comparé les performances du framework Web pour voir à quelle vitesse il fonctionne.
environnement
windows 10 pro
Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz 2.71GHz
RAM: 8.00 GB
system 64bit
Framework Web à utiliser Rust: Actix-web Python: Flask Julia: Genie
Création d'applications Hello World Tout d'abord, Actix
commander
cargo new hello-world
cd hello-world
Editez main.rs dans \ hello-world \ src.
main.rs
use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder};
#[get("/")]
async fn hello() -> impl Responder {
    HttpResponse::Ok().body("Hello world!")
}
#[post("/echo")]
async fn echo(req_body: String) -> impl Responder {
    HttpResponse::Ok().body(req_body)
}
async fn manual_hello() -> impl Responder {
    HttpResponse::Ok().body("Hey there!")
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
        App::new()
            .service(hello)
            .service(echo)
            .route("/hey", web::get().to(manual_hello))
    })
    .bind("0.0.0.0:8080")?
    .run()
    .await
}
Flask
Créez server.py dans un dossier approprié.
server.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
    return 'Hello World'
if __name__ == '__main__':
    app.debug = True
    app.run(host='0.0.0.0', port=8001)
Génie créé en Julia
commander
julia
using Genie
Genie.newapp("hello_world")
Comme l'ensemble de fichiers est créé automatiquement, quittez julia et modifiez le fichier routes.jl.
routes.jl
using Genie.Router
route("/") do
  "Hello - Welcome to Genie!"
end
Genie.AppServer.startup(8000, "0.0.0.0")
Maintenant que j'y pense, je pourrais avoir juste fait ce qui suit en julia sans créer un ensemble de fichiers. .. .. ..
"Hello - Welcome to Genie!"
end
Genie.AppServer.startup(8000, "0.0.0.0")```
 Laissez les trois applications Web en cours d'exécution et utilisez un autre PC (ubuntu20.04) pour mesurer les performances.
# Mesure du rendement
 Utilisez wrk2.
https://github.com/giltene/wrk2
#### **`commander`**
```ubuntu
sudo apt-get install -y build-essential libssl-dev git zlib1g-dev
git clone https://github.com/giltene/wrk2.git
cd wrk2
make
sudo cp wrk /usr/local/bin
wrk -v
wrk 4.0.0 [epoll] Copyright (C) 2012 Will Glozer
Usage: wrk <options> <url>                            
  Options:                                            
    -c, --connections <N>  Connections to keep open   
    -d, --duration    <T>  Duration of test           
    -t, --threads     <N>  Number of threads to use   
                                                      
    -s, --script      <S>  Load Lua script file       
    -H, --header      <H>  Add header to request      
    -L  --latency          Print latency statistics   
    -U  --u_latency        Print uncorrected latency statistics
        --timeout     <T>  Socket/request timeout     
    -B, --batch_latency    Measure latency of whole   
                           batches of pipelined ops   
                           (as opposed to each op)    
    -v, --version          Print version details      
    -R, --rate        <T>  work rate (throughput)     
                           in requests/sec (total)    
                           [Required Parameter]       
                                                      
                                                      
  Numeric arguments may include a SI unit (1k, 1M, 1G)
  Time arguments may include a time unit (2s, 2m, 2h)
Utilisez wrk2img pour afficher le graphique. https://github.com/PPACI/wrk2img
commander
pip3 install wrk2img
#Cela n'a pas fonctionné alors j'ai mis sudo
Je vais le mesurer. Voir ci-dessous pour savoir comment utiliser et afficher. https://qiita.com/RyujiKawazoe/items/1da4342d8854543ca4cc
commander
wrk -U -d 30 -c 100 -R 1000 --latency http://192.168.1.95:8080/ | wrk2img actix_100.png
wrk -U -d 30 -c 100 -R 1000 --latency http://192.168.1.95:8001/ | wrk2img flask_100.png
wrk -U -d 30 -c 100 -R 1000 --latency http://192.168.1.95:8000/ | wrk2img genie_100.png



Flask <Genie <actix, donc actix semble bien fonctionner.
Graphique lorsque le nombre de connexions actix est augmenté à la fin (10,100,1000,10000)

Il n'y a pas de charge jusqu'à 100, mais elle semble être affectée lorsqu'elle atteint 1000.
c'est tout