swift vs ruby
- Measure benchmark Vapor(swift) vs Rails(ruby)
test application
- hello world [ get ]
- posts table [ get , post ]
- users table [ get , post , patch , delete ]
- websocket
- その他時間があれば
環境
| cloud service | amazon aws |
| web server instance type | t2.micro |
| database | RDS instance (t2.micro) |
| test tool | jmater |
| repository | okamuroshogo/swift-benchmark-test |
ruby
| ruby | 2.3.0 |
| rails | 5.0.2 |
swift
| swift | 3.0.1 |
| vapor | v1.0.5-8-g72a59ce |
計測方法
- 時間が限られているので3回の平均値を結果とする
- throughput (req/sec)を計測する
Result
hello world(get)
| connection * roop | swift | ruby | その他 |
|---|---|---|---|
| 10 * 3 | 23.4 | 12.1 | |
| 100 * 3 | 47.1 | 12.6 | |
| 1000 * 3 | 80-172.6 | 14.0 | |
| 10000 * 3 | ???? | ???? | |
| 10000000000000000000000 * 1000000000 | ???? | ???? |
get and post
| connection * roop * api | swift | ruby | その他 |
|---|---|---|---|
| 5 * 3 * 2 | 25.3 | 8.3 | |
| 50 * 3 * 2 | now | now | |
| 500 * 3 * 2 | now | now | |
| 5000 * 3 * 2 | now | now | |
| 500000000000000000 * 1000000000 * 2 | ???? | ???? |
get, post, patch and delete
| connection * roop * api | swift | ruby | その他 |
|---|---|---|---|
| 2 * 3 * 4 | |||
| 25 * 3 * 4 | |||
| 250 * 3 * 4 | |||
| 2500 * 3 * 4 | |||
| 2500000000000000000 * 1000000000 * 4 | ???? | ???? |
感想
- 時間がなく、swiftをrelease buildできなかったため、両者developmentで計測をした。productionモードであれば結果は違うと思う。
- もっと頑張る
- 続きはQiita記事にまとめる
Built With
- benchmark
- ruby
- ruby-on-rails
- server
- swift
- vapor
Log in or sign up for Devpost to join the conversation.