elsaland / elsa

❄️ Elsa is a minimal runtime for JavaScript and TypeScript written in Go
MIT License
2.79k stars 61 forks source link

feat(core/serve): switch to fasthttp #99

Closed littledivy closed 3 years ago

littledivy commented 3 years ago

Benchmarks

Deno 1.4.2 (testing/bench/http_deno.ts) - adapted from https://deno.land/std@0.74.0/http/bench.ts

Running 10s test @ http://localhost:4500/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     0.94ms  540.03us  17.67ms   92.54%
    Req/Sec     5.47k   646.56     6.32k    91.00%
  108841 requests in 10.00s, 5.19MB read
Requests/sec:  10880.00
Transfer/sec:    531.25KB

Elsa (testing/bench/http_elsa.ts)

Running 10s test @ http://localhost:4501/ 
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.57ms    0.95ms  20.77ms   93.52%
    Req/Sec     3.37k   619.42     3.96k    80.00%
  67088 requests in 10.00s, 9.34MB read
Requests/sec:   6708.56
Transfer/sec:      0.93MB

Benchmarks were measured on Ubuntu 20.04 LTS x86_64 - Intel Core 2 Duo P9400 (2) @ 2 (meh)