{"id":17679981,"url":"https://github.com/costajob/ruby-pico-frameworks","last_synced_at":"2025-07-26T05:10:24.363Z","repository":{"id":77434137,"uuid":"67716428","full_name":"costajob/ruby-pico-frameworks","owner":"costajob","description":"Micro benchmark of Ruby pico-frameworks","archived":false,"fork":false,"pushed_at":"2019-10-07T13:43:33.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-05T21:29:04.036Z","etag":null,"topics":["benchmark","grape","micro-framework","pico-frameworks","puma","rack","roda","ruby","sinatra"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/costajob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-08T15:37:08.000Z","updated_at":"2019-10-07T13:43:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b8d0bcf-4d72-472e-81d1-553c74a3feaa","html_url":"https://github.com/costajob/ruby-pico-frameworks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costajob%2Fruby-pico-frameworks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costajob%2Fruby-pico-frameworks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costajob%2Fruby-pico-frameworks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costajob%2Fruby-pico-frameworks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/costajob","download_url":"https://codeload.github.com/costajob/ruby-pico-frameworks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246365640,"owners_count":20765546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","grape","micro-framework","pico-frameworks","puma","rack","roda","ruby","sinatra"],"created_at":"2024-10-24T09:05:00.999Z","updated_at":"2025-03-30T18:47:58.604Z","avatar_url":"https://github.com/costajob.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Table of Contents\n\n* [Scope](#scope)\n  * [What's pico?](#what-s-pico)\n  * [Why pico?](#why-pico)\n* [Included frameworks](#included-frameworks)\n  * [Raw Rack](#raw-rack)\n* [Application](#application)\n* [Benchmarks](#benchmarks)\n  * [Platform](#platform)\n  * [Puma](#puma)\n  * [Wrk](#wrk)\n  * [Bootstrap](#bootstrap)\n  * [Results](#results)\n* [Considerations](#considerations)\n  * [DSL on Rack](#dsl-on-rack)\n  * [Advanced routers](#advanced-routers)\n  * [Micro frameworks](#micro-frameworks)\n  * [Personal preference](#personal-preference)\n\n## Scope\nThis is an (un)fair benchmark of most mature (version \u003e= 1) pico-framework available for the Ruby programming language.\n\n### What's pico?\nWith pico i intend very tiny routing Web framework, with almost no dependencies but for Rack.  \n\n### Why pico?\nIn the micro-service hyping era, exposing fast, plain HTTP routes avoiding the heavyweight of bold frameworks is a desirable feature.  \nConsidering  a plain `Rails 6.0` app recorded a throughput of `7000 req/sec`, you can understand why micro-frameworks are a good option.\n\n## Included frameworks\nHere are the list of the pico-frameworks included in the benchmark:\n* [Sinatra](http://www.sinatrarb.com/): is one of the first micro-frameworks for ruby, the most feature complete of the pack\n* [Roda](http://roda.jeremyevans.net/): born form the ashes of [Cuba](http://cuba.is/) a performant tree-routing framework that can be extended via plug-ins \n* [Rack-App](http://www.rack-app.com/): a performant pico framework dependent on Rack only\n* [NyNy](http://alisnic.github.io/nyny/): a tiny Web framework, dependent from ActionPack\n* [Grape](https://github.com/ruby-grape/grape): an opinionated framework, with several dependencies\n* [Camping](https://github.com/camping/camping): proud to be a mere 4KB Web framework (the core part)\n* [Syro](http://soveran.github.io/syro/): another, Cuba inspired, simple router for web applications.\n\n### Raw Rack\nI also included a plain rack application to see how much each solution diverge from the raw metal.\n\n## Application\nThe \"application\" i tested is barely minimal: it is the HTTP version of the \"Hello World\" example.\n\n## Benchmarks\n\n### Platform\nI registered these benchmarks with a MacBook PRO 15 mid 2015 having these specs:\n* OSX Mojave\n* 2,2 GHz Intel Core i7 (4 cores)\n* 16 GB 1600 MHz DDR3\n* Ruby 2.6.3\n\n### Puma\nAll of the pico framework run over the mighty [Puma](http://puma.io/) application server.\n\n### Wrk\nI used [wrk](https://github.com/wg/wrk) as the loading tool.\nI measured each application server three times, picking the best lap:\n```\nwrk -t 4 -c 100 -d30s --timeout 2000 http://0.0.0.0:9292/\u003capp-name\u003e\n```\n\n### Bootstrap\n```\nbundle exec puma -w 8 -t 1 --preload -e production config.ru\n```\n\n### Results\nHere are the benchmarks results ordered by increasing throughput, along with the runtime dependencies footprint (measured by [lapidarius gem](https://rubygems.org/gems/lapidarius)).\n\n| App Server   | Throughput (req/s) | Runtime deps. |\n| :------------| -----------------: | ------------: |\n| Grape        |          16933.75  |           18  |\n| Sinatra      |          20322.81  |            4  |\n| Camping      |          23473.66  |            2  |\n| NyNy         |          30839.99  |            2  |\n| Rack-App     |          33372.97  |            1  |\n| Syro         |          43067.48  |            2  |\n| Roda         |          43116.18  |            1  |\n| Rack         |          43863.58  |            0  |\n\n## Considerations\nAfter have inspected the tested framework i dare to categorize them within three different groups:\n\n### DSL on Rack\nMinimal libraries built on top of Rack APIs, offering (in some cases) identical performance, but leaving the burden (freedom?) of more complex features to the developer.  \nSyro and NyNy fall within this group.\n\n### Advanced routers\nMore advanced routers that offers desirable features (i.e. filters, streaming) aside from a pretty routing interface.  \nRack-App and Camping falls within this group.\n\n### Micro frameworks\nLibraries that add to the advanced routing features, extensibility via plug-ins/contributions.  \nSinatra, Grape and Roda falls within this group.\n\n### Personal preference\n\n#### Plain Rack\nI admit that when i need raw performance over few endpoints i stick with raw Rack: it is pretty flexible and leave you writing less code than you think to get things done.  \n\n#### Roda\nWhen i need more features i stick with Roda, for the following reasons: \n* although it is feature-complete it only depends on Rack\n* is fast, very close to plain Rack\n* it integrates perfectly with [Sequel](http://sequel.jeremyevans.net/), also from the Ruby-hero [Jeremy Evans](https://github.com/jeremyevans). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostajob%2Fruby-pico-frameworks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcostajob%2Fruby-pico-frameworks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostajob%2Fruby-pico-frameworks/lists"}