Skip to content

Commit 472a935

Browse files
authored
Fixed the broken rack benchmarks. Upgraded ruby version to 3.2 and upgraded the gems used. The benchmarks only use postgres now and use the Sequel gem for database access only (no ORM, everything is done with raw SQL). Made some minor changes to improve query speed including preparing statements (TechEmpower#8240)
1 parent 06fada7 commit 472a935

23 files changed

+640
-535
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ build/
3333
*.patch
3434
*/bin/
3535

36+
3637
# intellij
3738
*.iml
3839
*.ipr
@@ -57,7 +58,8 @@ benchmark.cfg
5758

5859
# Visual Studio Code
5960
.vscode
60-
.history
61+
.history/
62+
.devcontainer
6163

6264
# vim
6365
.*.sw[a-p]

frameworks/Ruby/rack/.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Gemfile.lock

frameworks/Ruby/rack/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp

frameworks/Ruby/rack/Gemfile

+20-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
source 'http://rubygems.org'
1+
# frozen_string_literal: true
22

3-
gem 'mysql2', '0.4.5'
4-
gem 'unicorn', '5.3.0'
5-
gem 'puma', '3.12.6'
6-
gem 'rack', '2.0.8'
7-
gem 'json', '2.1.0'
8-
gem 'falcon'
3+
source 'https://rubygems.org'
4+
5+
gem 'rack', '~>3.0'
6+
gem 'connection_pool', '~>2.4'
7+
gem 'falcon', '~>0.42', platforms: %i[ruby mswin]
8+
gem 'jdbc-postgres', '~> 42.2', platforms: :jruby, require: 'jdbc/postgres'
9+
gem 'json', '~> 2.6', platforms: :jruby
10+
gem 'oj', '~> 3.14', platforms: %i[ruby mswin]
11+
gem 'pg', '~>1.5', platforms: %i[ruby mswin]
12+
gem 'puma', '~> 6.2'
13+
gem 'sequel'
14+
gem 'sequel_pg', platforms: %i[ruby mswin]
15+
gem 'tzinfo-data', '1.2023.3'
16+
gem 'unicorn', '~> 6.1', platforms: %i[ruby mswin], require: false
17+
18+
group :development do
19+
gem 'rack-test'
20+
gem 'rubocop', platforms: %i[ruby mswin]
21+
end

frameworks/Ruby/rack/Gemfile.lock

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
ast (2.4.2)
5+
async (2.5.0)
6+
console (~> 1.10)
7+
io-event (~> 1.1)
8+
timers (~> 4.1)
9+
async-container (0.16.12)
10+
async
11+
async-io
12+
async-http (0.60.1)
13+
async (>= 1.25)
14+
async-io (>= 1.28)
15+
async-pool (>= 0.2)
16+
protocol-http (~> 0.24.0)
17+
protocol-http1 (~> 0.15.0)
18+
protocol-http2 (~> 0.15.0)
19+
traces (>= 0.8.0)
20+
async-http-cache (0.4.3)
21+
async-http (~> 0.56)
22+
async-io (1.34.3)
23+
async
24+
async-pool (0.4.0)
25+
async (>= 1.25)
26+
build-environment (1.13.0)
27+
concurrent-ruby (1.2.2)
28+
connection_pool (2.4.0)
29+
console (1.16.2)
30+
fiber-local
31+
falcon (0.42.3)
32+
async
33+
async-container (~> 0.16.0)
34+
async-http (~> 0.57)
35+
async-http-cache (~> 0.4.0)
36+
async-io (~> 1.22)
37+
build-environment (~> 1.13)
38+
bundler
39+
localhost (~> 1.1)
40+
openssl (~> 3.0)
41+
process-metrics (~> 0.2.0)
42+
protocol-rack (~> 0.1)
43+
samovar (~> 2.1)
44+
fiber-local (1.0.0)
45+
io-event (1.1.7)
46+
json (2.6.3)
47+
kgio (2.11.4)
48+
localhost (1.1.10)
49+
mapping (1.1.1)
50+
nio4r (2.5.9)
51+
oj (3.14.2)
52+
openssl (3.1.0)
53+
parallel (1.23.0)
54+
parser (3.2.2.1)
55+
ast (~> 2.4.1)
56+
pg (1.5.3)
57+
process-metrics (0.2.1)
58+
console (~> 1.8)
59+
samovar (~> 2.1)
60+
protocol-hpack (1.4.2)
61+
protocol-http (0.24.1)
62+
protocol-http1 (0.15.0)
63+
protocol-http (~> 0.22)
64+
protocol-http2 (0.15.1)
65+
protocol-hpack (~> 1.4)
66+
protocol-http (~> 0.18)
67+
protocol-rack (0.2.4)
68+
protocol-http (~> 0.23)
69+
rack (>= 1.0)
70+
puma (6.2.1)
71+
nio4r (~> 2.0)
72+
rack (3.0.7)
73+
rack-test (2.1.0)
74+
rack (>= 1.3)
75+
rainbow (3.1.1)
76+
raindrops (0.20.1)
77+
regexp_parser (2.8.0)
78+
rexml (3.2.5)
79+
rubocop (1.51.0)
80+
json (~> 2.3)
81+
parallel (~> 1.10)
82+
parser (>= 3.2.0.0)
83+
rainbow (>= 2.2.2, < 4.0)
84+
regexp_parser (>= 1.8, < 3.0)
85+
rexml (>= 3.2.5, < 4.0)
86+
rubocop-ast (>= 1.28.0, < 2.0)
87+
ruby-progressbar (~> 1.7)
88+
unicode-display_width (>= 2.4.0, < 3.0)
89+
rubocop-ast (1.28.1)
90+
parser (>= 3.2.1.0)
91+
ruby-progressbar (1.13.0)
92+
samovar (2.1.4)
93+
console (~> 1.0)
94+
mapping (~> 1.0)
95+
sequel (5.68.0)
96+
sequel_pg (1.17.1)
97+
pg (>= 0.18.0, != 1.2.0)
98+
sequel (>= 4.38.0)
99+
timers (4.3.5)
100+
traces (0.9.1)
101+
tzinfo (2.0.6)
102+
concurrent-ruby (~> 1.0)
103+
tzinfo-data (1.2023.3)
104+
tzinfo (>= 1.0.0)
105+
unicode-display_width (2.4.2)
106+
unicorn (6.1.0)
107+
kgio (~> 2.6)
108+
raindrops (~> 0.7)
109+
110+
PLATFORMS
111+
x86_64-darwin-20
112+
x86_64-linux
113+
114+
DEPENDENCIES
115+
connection_pool (~> 2.4)
116+
falcon (~> 0.42)
117+
jdbc-postgres (~> 42.2)
118+
json (~> 2.6)
119+
oj (~> 3.14)
120+
pg (~> 1.5)
121+
puma (~> 6.2)
122+
rack-test
123+
rubocop
124+
sequel
125+
sequel_pg
126+
tzinfo-data (= 1.2023.3)
127+
unicorn (~> 6.1)
128+
129+
BUNDLED WITH
130+
2.4.10

frameworks/Ruby/rack/README.md

+14-20
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,31 @@ comparing a variety of web servers.
1111
## Infrastructure Software Versions
1212
The tests were run with:
1313

14-
* [Ruby 2.0.0-p0](http://www.ruby-lang.org/)
15-
* [JRuby 1.7.8](http://jruby.org/)
16-
* [Rubinius 2.2.10](http://rubini.us/)
17-
* [Rack 1.5.2](http://rack.github.com/)
18-
* [Unicorn 4.8.3](http://unicorn.bogomips.org/)
19-
* [TorqBox 0.1.7](http://torquebox.org/torqbox/)
20-
* [Puma 3.9](http://puma.io/)
21-
* [Falcon](https://github.com/socketry/falcon)
22-
* [Thin 1.6.2](http://code.macournoyer.com/thin/)
14+
* [Ruby 3.2](http://www.ruby-lang.org/)
15+
* [JRuby 9.4](http://jruby.org/)
16+
* [Rack 3.0.7](http://rack.github.com/)
17+
* [Unicorn 6.1.0](http://unicorn.bogomips.org/)
18+
* [Puma 6.2.1](http://puma.io/)
19+
* [Falcon 0.42.3](https://github.com/socketry/falcon)
20+
* [Sequel 5.68.0](https://sequel.jeremyevans.net/)
21+
22+
2323

2424
## Paths & Source for Tests
2525

26-
* [JSON Serialization](app/ruby_impl.rb) [[jruby version](app/jruby_impl.rb)]: "/json"
27-
* [Single Database Query](app/ruby_impl.rb) [[jruby version](app/jruby_impl.rb)]: "/db", [World Model](models/world.rb)
28-
* [Multiple Database Queries](app/ruby_impl.rb) [[jruby version](app/jruby_impl.rb)]: "/query?queries={#}", [World Model](models/world.rb)
29-
* _Fortunes: N/A_
30-
* [Database Updates](app/ruby_impl.rb) [[jruby version](app/jruby_impl.rb)]: "/updates?queries={#}", [World Model](models/world.rb)
31-
* [Plaintext](app/ruby_impl.rb) [[jruby version](app/jruby_impl.rb)]: "/plaintext"
26+
* Routing and controller logic is in hello_world.rb
27+
* Database access is done with pg_db.rb (only postgres is supported and we are using sequel to connect and run queries)
28+
* No ORM is used.
3229

3330
## Get Help
3431

3532
### Experts
3633

3734
* Samuel Williams (@ioquatix) -- Async & Falcon developer.
35+
* Tim Uckun (@timuckun)
3836

39-
### Community
40-
41-
* `#rack` IRC Channel ([irc.freenode.net](http://freenode.net/))
42-
* [Rack Google Group](https://groups.google.com/forum/#!forum/rack-devel)
4337

4438
### Resources
4539

4640
* [Rack Source Code](https://github.com/rack/rack)
47-
* [PR: passenger-install-apache2-module doesn't work on ruby 2.0](https://github.com/FooBarWidget/passenger/pull/71)
41+

frameworks/Ruby/rack/app/jruby_impl.rb

-91
This file was deleted.

frameworks/Ruby/rack/app/ruby_impl.rb

-58
This file was deleted.

0 commit comments

Comments
 (0)