{"id":16431993,"url":"https://github.com/davidcelis/api-benchmarks","last_synced_at":"2025-06-20T06:04:24.383Z","repository":{"id":13770378,"uuid":"16465295","full_name":"davidcelis/api-benchmarks","owner":"davidcelis","description":"Benchmarks for various Ruby API frameworks.","archived":false,"fork":false,"pushed_at":"2016-12-30T10:11:26.000Z","size":658,"stargazers_count":18,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-20T06:02:51.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/davidcelis.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}},"created_at":"2014-02-02T22:45:58.000Z","updated_at":"2023-11-03T16:43:59.000Z","dependencies_parsed_at":"2022-09-23T15:20:50.349Z","dependency_job_id":null,"html_url":"https://github.com/davidcelis/api-benchmarks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidcelis/api-benchmarks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Fapi-benchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Fapi-benchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Fapi-benchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Fapi-benchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidcelis","download_url":"https://codeload.github.com/davidcelis/api-benchmarks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Fapi-benchmarks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260891051,"owners_count":23077903,"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":[],"created_at":"2024-10-11T08:35:21.707Z","updated_at":"2025-06-20T06:04:19.362Z","avatar_url":"https://github.com/davidcelis.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Benchmarks\n\nThis repository provides applications in various Ruby web frameworks for the purposes of easy benchmarking. All benchmarks are currently run using [wrk][wrk], though other benchmarking tools may be used in the future.\n\n## Setup\n\nHere's the software used to run these benchmarks:\n\n* [Ruby 2.1.2][ruby] (with bundler: `gem install bundler`)\n* [wrk][wrk]\n\nIf one of these isn't installed:\n\n```bash\n# Ruby\n$ brew install chruby ruby-install\n$ ruby-install ruby 2.1.2\n$ chruby ruby-2.1.2\n\n# wrk\n$ brew install wrk\n```\n\n## Running benchmarks\n\nFirst, set up the benchmarking database:\n\n```bash\n$ bundle install\n```\n\nThen, you can run benchmarks:\n\n```bash\n$ rake benchmark:all\n\n# Or, run benchmarks for one framework\n$ rake benchmark:rails\n```\n\nTo run benchmarks on Heroku (recommended, so that the web servers are not competing with the load generation tool for resources), first set up Heroku:\n\n```bash\n$ brew install heroku\n$ heroku create\n```\n\nThen, you can run benchmarks:\n\n```bash\n$ HEROKU=true rake benchmark:all\n\n# Or, run benchmarks for one framework\n$ HEROKU=true rake benchmark:rails\n```\n\n### Benchmarking Information\n\nAll applications boot via `rackup` using the [Puma][puma] dispatcher. Each application defines two endpoints:\n\n * `/empty` (renders an empty response body)\n * `/numbers/:count` (renders an array of `:count` numbers as JSON, defaults to 1000 numbers)\n\nEach endpoint is hit consecutively for 3 minutes using `wrk -t 2 -c 10 -d 3m`.\n\n## Results\n\nNote: _I've ordered results by the average number of requests/sec each framework was able to handle. Response time seems to vary, and I'm unsure of whether the response time reported is actually an average or some other metric._\n\n### `/empty`\n\n| Framework                   | Requests | Response Time | Requests/sec |\n|-----------------------------|----------|---------------|--------------|\n| [Hobbit][hobbit]            | 391970   | 13.74ms       | 2177.60      |\n| [Cuba][cuba]                | 365010   | 12.26ms       | 2027.83      |\n| [Camping][camping]          | 346946   | 12.84ms       | 1927.47      |\n| [Crepe][crepe]              | 337712   | 10.30ms       | 1876.18      |\n| [Sinatra][sinatra]          | 253480   | 9.48ms        | 1408.21      |\n| [Grape][grape]              | 237833   | 12.27ms       | 1321.29      |\n| [Rails::Metal][rails-metal] | 197913   | 11.37ms       | 1099.50      |\n| [Rails::API][rails-api]     | 131132   | 14.49ms       | 728.50       |\n| [Rails][rails]              | 124766   | 16.22ms       | 693.14       |\n\n### `/numbers/1000`\n\n| Framework                   | Requests | Response Time | Requests/sec |\n|-----------------------------|----------|---------------|--------------|\n| [Hobbit][hobbit]            | 282693   | 16.24ms       | 1570.50      |\n| [Camping][camping]          | 262113   | 11.02ms       | 1456.18      |\n| [Cuba][cuba]                | 258000   | 11.29ms       | 1433.32      |\n| [Sinatra][sinatra]          | 204070   | 8.82ms        | 1133.53      |\n| [Crepe][crepe]              | 186288   | 20.36ms       | 1034.93      |\n| [Grape][grape]              | 174436   | 14.60ms       | 969.07       |\n| [Rails::Metal][rails-metal] | 102592   | 18.11ms       | 569.93       |\n| [Rails::API][rails-api]     | 58518    | 32.47ms       | 325.09       |\n| [Rails][rails]              | 56863    | 33.32ms       | 315.90       |\n\n### System Information\n\nLoad is generated on a 15\" Retina MacBook Pro with the following specifications:\n\n * CPU: 2.3 GHz Intel Core i7\n * RAM: 16 GB 1600 MHz DDR3\n * GPU: Intel HD Graphics 4000 1024 MB\n * OS: Mac OS X 10.9.2\n\nAll web applications were run on Heroku, using a single free dyno.\n\n[camping]: https://github.com/camping/camping\n[cuba]: https://github.com/soveran/cuba\n[crepe]: https://github.com/crepe/crepe\n[grape]: https://github.com/intridea/grape\n[hobbit]: https://github.com/patriciomacadden/hobbit\n[nyny]: https://github.com/alisnic/nyny\n[rails]: https://github.com/rails/rails\n[rails-api]: https://github.com/rails-api/rails-api\n[rails-metal]: http://api.rubyonrails.org/classes/ActionController/Metal.html\n[sinatra]: https://github.com/sinatra/sinatra/\n[puma]: https://github.com/puma/puma\n[ruby]: https://github.com/ruby/ruby\n[wrk]: https://github.com/wg/wrk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcelis%2Fapi-benchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidcelis%2Fapi-benchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcelis%2Fapi-benchmarks/lists"}