zap :zap:
The mission of zap is, to deliver a fast rust web framework that just supports the basics.
About
This code is based on tokio's minihttp project, so a big thanks to them. (source)
How to use
Add the following to your Cargo.toml:
[]
= { = "https://github.com/oldaniel/zap" }
Speed
So zap is not only fast, it is wapping x2,7 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 *;
use status;
Zap
This example can be run, by:
$ git clone https://github.com/oldaniel/zap && cd zap
$ cargo run --example hello-world --release
extern crate zap;
use io;
use ;
;
Benchmark Results
The benchmarks had been done with the following command: wrk -t16 -c500 -d10s http://127.0.0.1:8080 --latency
Technical details about the server:
- Intel Core I7-6700K, hyperthreaded
- 16GB RAM, 2400MHZ
Iron
Running 10s test @ http://127.0.0.1:8080
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 214.85us 622.27us 78.67ms 99.24%
Req/Sec 77.20k 51.31k 191.91k 51.98%
Latency Distribution
50% 183.00us
75% 219.00us
90% 304.00us
99% 746.00us
3103506 requests in 10.09s, 337.41MB read
Requests/sec: 307581.17
Transfer/sec: 33.44MB
Zap
Running 10s test @ http://127.0.0.1:8080
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 0.99ms 1.67ms 46.05ms 90.30%
Req/Sec 53.85k 15.70k 110.61k 71.73%
Latency Distribution
50% 401.00us
75% 1.27ms
90% 2.61ms
99% 6.66ms
8622335 requests in 10.09s, 559.16MB read
Requests/sec: 854783.80
Transfer/sec: 55.43MB
Todo
Some things we still need to make:
- Make it faster
- URL and body parsing
- Request key storing
Credist & License
A project by Daniel Oltmanns.