mroth / phoenix-showdown

:horse_racing: benchmark Sinatra-like web frameworks
705 stars 70 forks source link

Remove unnecessary plugs from the browser pipeline #33

Closed ghost closed 8 years ago

mroth commented 8 years ago

@koolhazcker I'm curious about the reasoning for these. Did you find this made a substantial difference in performance on your machine?

ghost commented 8 years ago

@mroth it was noted that CSRF token generation can hurt performance a bit [1], [2]. But it is not the reasoning for deleting them. These plugs were not present in the original benchmark. As for the difference, I don't think there is any. Here's what I got with these plugs being in the pipeline:

wrk -t4 -c100 -d30S --timeout 2000 "http://127.0.0.1:4000/showdown" 
Running 30s test @ http://127.0.0.1:4000/showdown
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    10.13ms    9.48ms 131.59ms   89.43%
    Req/Sec     2.67k   552.38     4.72k    75.06%
  319363 requests in 30.08s, 731.63MB read
Requests/sec:  10617.18
Transfer/sec:     24.32MB

And without:

wrk -t4 -c100 -d30S --timeout 2000 "http://127.0.0.1:4000/showdown"
Running 30s test @ http://127.0.0.1:4000/showdown
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     8.88ms    9.22ms 158.45ms   89.98%
    Req/Sec     3.18k   638.76     6.84k    73.93%
  379904 requests in 30.09s, 746.42MB read
Requests/sec:  12623.83
Transfer/sec:     24.80MB

[1] https://www.reddit.com/r/elixir/comments/4e0wuh/expressjs_vs_phoenix_framework_ab_load_test/d1w5ziy [2] https://www.reddit.com/r/elixir/comments/48ke69/any_reason_why_elixirphoenix_did_so_badly_in/d0ko6ai

mroth commented 8 years ago

Cool, thank you. I'm going to merge to provide cleaner starting point for others in the future, but am not going to redo the benchmarks since we don't expect a significant change. Thanks for your contribution!