Super Fast & High Performance minimalist web framework for rust

Overview

oxidy

Super Fast & High Performance minimalist web framework for rust

() { ctx.response.body = "Index Page".to_string(); } fn main() { let mut app = Server::new(); app.middleware(mid); app.get("/", index); app.listen("127.0.0.1:3000"); }">
use oxidy::structs::Context;
use oxidy::server::Server;
use oxidy::structs::Middleware;
use std::time::Instant;

fn mid(_: &mut Context) -> Middleware {
    let start = Instant::now();
    (
        true,
        Some(Box::new(move |_: &mut Context| {
            let end = Instant::now();
            println!("Response Time: {:?}", end - start);
        })),
    )
}

fn index(ctx: &mut Context) -> () {
    ctx.response.body = "Index Page".to_string();
}

fn main() {
    let mut app = Server::new();
    app.middleware(mid);
    app.get("/", index);
    app.listen("127.0.0.1:3000");
}

Description

Super Fast & High Performance minimalist web framework for rust built on top of rust standard library TcpListener & TcpStream.

This project is highly inspired by

  • Nodejs Express
  • Nodejs Koa

Features

  • Main Focus on Super Fast & High Performance.
  • Very minimum LOC (Lines of code).
  • No Unsafe Code.
  • Robust Routing.
  • Allow Middlewares.
  • Easy to build your own middleware;
  • Allow Multi Threading.

Install

This is a crate (Rust Module) available on crate.io. Before install download & install rust.

Quick Start

  • Add oxidy to your dependency in Cargo.toml file
"">
[dependencies]
oxidy = "
    
     "

    
  • Paste this code below in your src/main.rs file
use oxidy::structs::Context;
use oxidy::server::Server;

fn index(ctx: &mut Context) -> () {
    ctx.response.body = "Index Page".to_string();
}

fn main() {
    let mut app = Server::new();
    app.get("/", index);
    app.listen("127.0.0.1:3000");
}
  • cargo run to run the server in development or cargo run --release to run the server in release profile.

Benchmark

Apache Bench:

oxidy | Req/Sec: 16.5K | Latency: 60MS

actix web | Req/Sec: 15.5K | Latency: 63MS

Loadtest

oxidy | Req/Sec: 4.5K | Latency: 219MS

actix web | Req/Sec: 2.9K | Latency: 339MS

Check Full Benchmark

Tested (2022-02-06) On Rust Stable Version & Edition 2021 With Release Flag

License

GNU GPL v2.0

You might also like...
A Rust web framework

cargonauts - a Rust web framework Documentation cargonauts is a Rust web framework intended for building maintainable, well-factored web apps. This pr

A rust web framework with safety and speed in mind.

darpi A web api framework with speed and safety in mind. One of the big goals is to catch all errors at compile time, if possible. The framework uses

A web framework for Rust.

Rocket Rocket is an async web framework for Rust with a focus on usability, security, extensibility, and speed. #[macro_use] extern crate rocket; #[g

Rust / Wasm framework for building client web apps
Rust / Wasm framework for building client web apps

Yew Rust / Wasm client web app framework Documentation (stable) | Documentation (latest) | Examples | Changelog | Roadmap | 简体中文文档 | 繁體中文文檔 | ドキュメント A

A full-featured and easy-to-use web framework with the Rust programming language.

Poem Framework A program is like a poem, you cannot write a poem without writing it. --- Dijkstra A full-featured and easy-to-use web framework with t

Experiments with Rust CRDTs using Tokio web application framework Axum.

crdt-genome Synopsis Experiments with Rust CRDTs using Tokio web application framework Axum. Background Exploring some ideas of Martin Kleppmann, part

Implementation of the RealWorld backend API spec in Actix, Rust's powerful actor system and most fun web framework.
Implementation of the RealWorld backend API spec in Actix, Rust's powerful actor system and most fun web framework.

Actix codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API. ❗ (2021/05/13) This cod

A web framework for Rust programing language

kalgan A web framework for Rust programing language. Getting Started Create your project with cargo: cargo new project Add the dependency in Cargo.tom

Demo of Rust and axum web framework

Demo of Rust and axum web framework Demonstration of: Rust: programming language that focuses on reliability and stability. axum: web framework that f

Owner
null
Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix 16.2k Jan 2, 2023
Noria: data-flow for high-performance web applications

Noria: data-flow for high-performance web applications Noria is a new streaming data-flow system designed to act as a fast storage backend for read-he

MIT PDOS 4.5k Dec 28, 2022
Sauron is an html web framework for building web-apps. It is heavily inspired by elm.

sauron Guide Sauron is an web framework for creating fast and interactive client side web application, as well as server-side rendering for back-end w

Jovansonlee Cesar 1.7k Dec 26, 2022
A (flash) message framework for actix-web. A port to Rust of Django's message framework.

actix-web-flash-messages Flash messages for actix-web Web applications sometimes need to show a one-time notification to the user - e.g. an error mess

Luca Palmieri 31 Dec 29, 2022
Thruster - An fast and intuitive rust web framework

A fast, middleware based, web framework written in Rust

null 913 Dec 27, 2022
Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies

Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies, reactivity without a virtual DOM, and extreme customizability

arctic_hen7 1.2k Jan 8, 2023
Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

null 3.6k Jan 6, 2023
Hot reload static web server for deploying mutiple static web site with version control.

SPA-SERVER It is to provide a static web http server with cache and hot reload. 中文 README Feature Built with Hyper and Warp, fast and small! SSL with

null 7 Dec 18, 2022
Code template for a production Web Application using Axum: The AwesomeApp Blueprint for Professional Web Development.

AwesomeApp rust-web-app More info at: https://awesomeapp.dev/rust-web-app/ rust-web-app YouTube episodes: Episode 01 - Rust Web App - Course to Produc

null 45 Sep 6, 2023
A highly customizable, full scale web backend for web-rwkv, built on axum with websocket protocol.

web-rwkv-axum A axum web backend for web-rwkv, built on websocket. Supports BNF-constrained grammar, CFG sampling, etc., all streamed over network. St

Li Junyu 12 Sep 25, 2023