• Stars
    star
    244
  • Rank 165,885 (Top 4 %)
  • Language
    Ruby
  • Created almost 11 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Benchmark some Ruby web microframeworks, just for fun

bench some web microframeworks (Ruby)

Because we don't have enough drama, let's bench some hello world apps!

Why?

As part of some research, collected some benchmark around Ruby web microframeworks.

The idea is bench the performance from Rack, throught the stack of the framework to the minimum representation of an application (Hello World apps).

It is not the goal to bechmark hits to the database or external services, nor to do a silly fibonacci-as-a-service, ok?

What?

Rack 2 compatible frameworks

Please note that while Rails has been added to the list, it is just a minimalistic representation with ActionPack gem (using API and Metal, no full middleware stack, etc). You shouldn't take the performance numbers mentioned here about Rails (or any other) as scientific and decision-taking references.

How?

Used wrk to benchmark, locally, a burst of requests (in 2 threads) over 10 seconds. The command line used was:

$ wrk -t 2 http://localhost:9292/

All the frameworks using Puma on Ruby 2.4, in production mode with 16 threads:

$ puma -e production -t 16:16 apps/<framework.ru>

Run benchmark for all frameworks

# use `bundle exec`, if needed
$ bench/summary-memory
$ bench/summary-speed

Have some numbers around?

Yup, I do:

Requests/sec

Framework            Requests/sec  % from best
----------------------------------------------
rack                     15839.64      100.00%
watts                    13585.65       85.77%
syro                     13306.01       84.00%
roda                     11776.27       74.35%
cuba                     11501.96       72.62%
rack-response            11480.11       72.48%
hobbit                   11140.22       70.33%
hobby                    10606.80       66.96%
hanami-router            10247.61       64.70%
newark                    8896.35       56.17%
rambutan                  8466.83       53.45%
plezi                     8240.07       52.02%
rackstep                  8187.32       51.69%
rack-app                  7473.52       47.18%
rails-metal               6598.65       41.66%
flame                     5454.46       34.44%
sinatra                   3977.30       25.11%
grape                     2937.03       18.54%
rails-api                 1211.33        7.65%

Memory Allocation/Request

Framework       Allocs/Req Memsize/Req
--------------------------------------
rack                    41        2920
roda                    45        3608
syro                    45        3608
cuba                    47        3688
watts                   48        3200
hobbit                  49        3928
hobby                   53        4240
rack-response           56        4136
rails-metal             60        5728
plezi                   66        5040
hanami-router           68        4880
newark                  72        5928
rackstep                81        4944
rack-app                83        7184
rambutan                83        5944
flame                  125        8536
sinatra                191       12512
grape                  272       20800
rails-api              385       28017

Hardware

These numbers were collected on:

  • Ubuntu 16.10 64-bit (kernel: 4.8.0-56-generic)
  • Dell XPS 13 (9343, QHD, Developer Edition)
  • Intel® Coreâ„¢ i7-5500U CPU @ 2.40GHz × 4
  • 8GB RAM
  • 256GB SSD
  • ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]

More Repositories

1

gem-compiler

A RubyGems plugin that generates binary gems
Ruby
153
star
2

radix

Radix Tree implementation for Crystal
Crystal
102
star
3

mysql-gem

MySQL/Ruby Bindings, wrapped as Gem with improved cross-platform support
C
53
star
4

brooklyn

Brooklyn - Small web tool on top of Rack
Ruby
23
star
5

win32console

DEPRECATED: Mirror of Win32::Console Gem project with improved MinGW support
Ruby
22
star
6

service_wrapper

Wrap any command-line tool as Windows service (WiP)
Visual Basic
21
star
7

beryl

Action-focused HTTP routing library for Crystal
Crystal
20
star
8

homelab-headscale

Making it easy (for me) to deploy a production-ready Headscale setup to Fly.io
Dockerfile
17
star
9

hydrofoil-crystal

Opinionated, Alpine-based development container for Crystal
Dockerfile
12
star
10

mongrel_service

Mongrel::Service
Visual Basic
12
star
11

binfiles

Personal scripts Tools
Visual Basic
11
star
12

drift

SQL-driven schema migration tool and library for Crystal
Crystal
10
star
13

crystal-state_machine

State Machine for Crystal
Crystal
9
star
14

fenix

OBSOLETE: Rebirth and renewal of Ruby (see README)
Ruby
6
star
15

test-ruby-c-extension

Test ground of rake-compiler extension compilation. Useful for reporting bugs during cross-compilation issues
Ruby
6
star
16

template-laravel-twill

An empty Laravel + Twill project template using Docker and Docker compose for local development
PHP
6
star
17

nekro

Ruby to Neko (playground)
Ruby
5
star
18

testly

Testly is a simple, minimal testing library aimed to programmers using FreeBASIC to implement TDD development techniques
Visual Basic
5
star
19

magic-haversack

Facilitate Crystal cross-compilation
Shell
5
star
20

learn-chef

Explore ideas and try to understand how Chef works
Ruby
4
star
21

simple_logger

SimpleLogger is a simple, minimal logger library for programmers using FreeBASIC inspired in ruby logger or log4cpp.
4
star
22

learn-ansible

Explore some playbooks organization with Ansible
Shell
4
star
23

exp-crystal-hello-binary

🧪 Compile and package static binaries with Crystal
Crystal
4
star
24

hydrofoil-php

Opinionated, PHP environment tailored for development
Dockerfile
3
star
25

isolate-lockdown

Lockdown your isolated gems, give them speed.
Ruby
3
star
26

simple-bench-ruby-io

Provide a simple test ground to benchmark Ruby require bottlenecks
Ruby
2
star
27

sinatra-hello

Testing Cloud deployment with Sinatra
Ruby
2
star
28

experiments

Place to put all those little experiments that are too small for their own repository.
C
2
star
29

servicefb

ServiceFB simplify programmers work when creating NT Services using FreeBASIC as programming language. It also encapsulate most of the Win32 API and provide a clean event-driven like interface.
2
star
30

autotest-snarl

Clean and stolen easy integration of Net::Snarl and autotest
Ruby
1
star
31

autobuild-rubies

Automated Ruby builds using Travis-CI
Shell
1
star
32

test-crystal-cross-compiling

A container image that combines Zig toolchain and packages for different platforms to facilitate compiling Crystal apps
Dockerfile
1
star
33

test-unicode

Sample files for testing unicode capabilities of Windows consoles
Ruby
1
star
34

mini_service

Create Windows Services, and just that
Ruby
1
star
35

net-snarl

Basic Snarl SNP implementation in Ruby
Ruby
1
star
36

test-crystal-sqlite3-db

Repo showcasing multi-thread issues with crystal-sqlite3 (crystal-lang/crystal-sqlite3#87)
Crystal
1
star
37

dockerfiles

Experimental Docker containers for development (DEPRECATED)
Shell
1
star
38

crystal-xbuild-container

Container image to ease cross-compilation of Crystal applications
Dockerfile
1
star
39

greek-steam

Debian-based PHP container image for production usage, tailored for Laravel Vapor & Twill CMS
Dockerfile
1
star