I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.
Framework | Throughput (req/s) | Latency (ms) | Consistency (σ ms) |
---|
threads 1, 4 | |
workers 2 | |
preload_app! | |
environment 'development' | |
bind 'tcp://0.0.0.0:3000' | |
ssl_bind '127.0.0.1', '5002', { | |
key: 'doc/certs/server.key', | |
cert: 'doc/certs/server.crt' | |
} |
#!/bin/bash | |
wget "https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz" | |
tar -xf libevent-2.0.21-stable.tar.gz | |
cd libevent-2.0.21-stable | |
./configure | |
make | |
make verify | |
sudo make install | |
sudo ldconfig |
I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.
Framework | Throughput (req/s) | Latency (ms) | Consistency (σ ms) |
---|
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
module Application | |
module Controllers | |
class MyController < Sinatra::Base | |
helpers Sinatra::Streaming | |
class << self | |
def stream(method, path, opts = {}, &block) | |
send(method, path, opts) do | |
stream do |out| | |
timer = EventMachine::PeriodicTimer.new(10) { out << "\0" } |
Suppose you have weird taste and you absolutely want:
module Genetic exposing (Config, Goal(..), run) | |
import List.Extra as List | |
import Random exposing (Generator) | |
import Random.Extra as Random | |
import Random.List | |
type alias Config solution = | |
{ newSolution : Generator solution |