Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pcai/ruby-http-benchmarks
https://github.com/pcai/ruby-http-benchmarks
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/pcai/ruby-http-benchmarks
- Owner: pcai
- Created: 2022-11-11T06:24:41.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-09T16:48:41.000Z (9 months ago)
- Last Synced: 2024-10-16T14:54:22.289Z (3 months ago)
- Language: Ruby
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ruby-http-benchmarks
Some benchmarks comparing memory usage among various http clients in ruby. The goal is to measure the memory usage of loading the library into the process AND making a single GET request to an arbitrary URL.
# Install
`bundle install`
# Benchmarking
Start the server: `bundle exec puma`
In a new terminal, run the benchmark: `ruby download.rb`
# Results
In ruby 3.1.2:
```
Net::HTTP: 0.16 MB
RestClient: 1.72 MB
faraday: 2.43 MB
HTTParty: 5.57 MB
http.rb: 7.53 MB
```
# Known issuesThe results are fairly reproducible, but the order seems to drastically change the results, with a big penalty for being in the first position.
For the results above I varied the position of the libraries for each run and picked the best of 5 runs.
# Credits
Inspired by this gist https://gist.github.com/janko/238bbcc78b369ce3438365e5507bc671