All Projects → oltdaniel → zap

oltdaniel / zap

Licence: MIT license
⚡ fast http framework for rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to zap

Eemeter
An open source python package for implementing and developing standard methods for calculating normalized metered energy consumption and avoided energy use.
Stars: ✭ 134 (+162.75%)
Mutual labels:  efficiency
rocket
Light-weight web framework for Go
Stars: ✭ 26 (-49.02%)
Mutual labels:  web-framework
go-zero
A cloud-native Go microservices framework with cli tool for productivity.
Stars: ✭ 23,294 (+45574.51%)
Mutual labels:  web-framework
Ybmodelfile
根据 JSON 自动生成 Model 文件(数据模型)
Stars: ✭ 209 (+309.8%)
Mutual labels:  efficiency
Spvnas
[ECCV 2020] Searching Efficient 3D Architectures with Sparse Point-Voxel Convolution
Stars: ✭ 239 (+368.63%)
Mutual labels:  efficiency
fano
Pascal web application framework
Stars: ✭ 90 (+76.47%)
Mutual labels:  web-framework
Strcf
Learning Spatial-Temporal Regularized Correlation Filters for Visual Tracking (CVPR 2018)
Stars: ✭ 127 (+149.02%)
Mutual labels:  efficiency
kapsule
Kapsule - A closure based Web Component library
Stars: ✭ 43 (-15.69%)
Mutual labels:  web-framework
poggit
GitHub application for managing PocketMine-family plugins, and website for sharing plugins.
Stars: ✭ 96 (+88.24%)
Mutual labels:  web-framework
autoslot
Automatic __slots__ for your Python classes
Stars: ✭ 53 (+3.92%)
Mutual labels:  efficiency
Linqit
Extend python lists with .NET's LINQ syntax for clean and fast coding. Also known as PINQ.
Stars: ✭ 222 (+335.29%)
Mutual labels:  efficiency
Pathfinder.vim
Vim plugin to suggest better movements
Stars: ✭ 228 (+347.06%)
Mutual labels:  efficiency
vuecket
Power of Vue.JS married with magic of Apache Wicket
Stars: ✭ 31 (-39.22%)
Mutual labels:  web-framework
Ghostskb
Smart input method switcher like a ghost
Stars: ✭ 186 (+264.71%)
Mutual labels:  efficiency
geronimo
Mirror of Apache Geronimo
Stars: ✭ 35 (-31.37%)
Mutual labels:  web-framework
Deadline
A simple TODO with countdown timer
Stars: ✭ 134 (+162.75%)
Mutual labels:  efficiency
farrow
A Type-Friendly Web Framework for Node.js
Stars: ✭ 748 (+1366.67%)
Mutual labels:  web-framework
tanuki
Tanuki is a polyglot web framework that allows you to develop web applications and services in multiple programming languages.
Stars: ✭ 62 (+21.57%)
Mutual labels:  web-framework
whistle
Experiment to build single page apps in Elixir
Stars: ✭ 52 (+1.96%)
Mutual labels:  web-framework
InDiv
an angular like web mvvm framework.一个类 angular 前端框架。https://dimalilongji.github.io/InDiv
Stars: ✭ 88 (+72.55%)
Mutual labels:  web-framework

zap

GitHub issues Travis GitHub stars Crates.io Crates.io

The mission of zap is, to deliver a basic, but fast rust web server library.

Documentation

About

This code is based on tokio's minihttp project, so a big thanks to them. (source)

The goal of this project is, to show how fast Rust can be. It isn't made for huge complex applications, just a test project for benchmark reasons.

How to use

Add the following to your Cargo.toml:

[dependencies]
zap = "0.0.4"

Speed

So zap is not only fast, it is wapping 2.96 times faster than iron, which is based on hyper. Benchmarks below:

Benchmark Code

Iron

This code had been taken from the ironframework.io webpage.

extern crate iron;

use iron::prelude::*;
use iron::status;

fn main() {
    fn hello_world(_: &mut Request) -> IronResult<Response> {
        Ok(Response::with((status::Ok, "Hello World!")))
    }

    Iron::new(hello_world).http("localhost:3000").unwrap();
}

Zap

This example can be run, by:

$ git clone https://github.com/oltdaniel/zap && cd zap
$ cargo run --example hello-world --release
extern crate zap;

use std::io::Error as ZapError;
use zap::prelude::*;

struct HelloWorld;

impl Handler for HelloWorld {
    type Request = Request;
    type Response = Response;
    type Error = ZapError;
    type Future = ZapResult;

    fn call(&self, _: Request) -> ZapResult {
        let mut resp = Response::new();

        resp.body("Hello World!");

        resp.ok()
    }
}

fn main() {
    let addr = "0.0.0.0:8080".parse().unwrap();
    let mut server = Server::new(Http, addr);
    server.threads(8);
    server.serve(|| Ok(HelloWorld));
}

Benchmark Results

The benchmark results have been computed with this command: wrk -t16 -c500 -d10s http://127.0.0.1:8080 --latency

Technical details about the server:

  • Intel Core I7-6700K, hyper-threaded
  • 16GB RAM, 2400MHZ

Detailed results: in the wiki.

Iron

[...]
Requests/sec: 307581.17
Transfer/sec:     33.44MB

Zap

[...]
Requests/sec: 912832.31
Transfer/sec:     40.90MB

Credits & License

Daniel Oltmanns & others

Basically do what you'd like to.

GitHub license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].