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) |
---|
print( | |
"hello" | |
) | |
print([ | |
1, | |
2, | |
]) | |
vs |
defmodule MyApp do | |
use Application | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
children = [ | |
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [ | |
dispatch: dispatch | |
]) |
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) |
---|
This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible.
We've been using this for months in multiple projects without any issues. Please ping be if there is any issues with this script and I'll update it.
It should be generic enough to work on any elixir app using mix.
If you have a elixir_buildpack.config
, then enable that section in the build script to keep versions in sync!
git ls-files | egrep '\.erl|\.ex[s]$' | xargs cat | sed '/^$/d' | wc -l |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
#!/bin/bash -e | |
# Lifted from: https://github.com/adrienthebo/git-tools/blob/master/git-truncate | |
# Note: seem to be finding the need to run this twice over to commit the truncate | |
if [[ (-z $1) || (-z $2) ]]; then | |
echo "Usage: $(basename $0) <drop before SHA1 commit> <branch>" | |
exit 1 | |
fi | |
git filter-branch --parent-filter "sed -e 's/-p $1[0-9a-f]*//'" \ |
let blacklists = ["http://localhost/*"] | |
let scrollduration = 10 | |
set numerichints | |
set typelinkhints |
namespace :grape do | |
desc 'Print compiled grape routes' | |
task :routes => :environment do | |
API.routes.each do |route| | |
puts route | |
end | |
end | |
end |
@lpil the way I do this for my own snippets is to invent my own file types for libraries and then have a project local vimrc that sets those filetypes.
For example, if I have a ruby project using the rspec library my project-local vimrc might contain something like
augroup ExtraTypes
autocmd!
autocmd BufNewFile,BufRead *_spec.rb set ft+=.rspec
augroup end