Skip to content

Commit fb17d2a

Browse files
authored
[rails] Use regular json serializer (#9389)
The regular json serializer should be about as fast as OJ, after some recent performance improvements: https://github.com/ruby/json/blob/master/CHANGES.md
1 parent 7728841 commit fb17d2a

File tree

4 files changed

+2
-9
lines changed

4 files changed

+2
-9
lines changed

frameworks/Ruby/rails/Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
source 'https://rubygems.org'
22

3-
gem 'oj', '~> 3.16'
43
gem 'rails', '~> 7.2.0'
54
gem 'redis', '~> 5.0'
65
gem 'tzinfo-data'

frameworks/Ruby/rails/Gemfile.lock

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ GEM
137137
irb (1.14.1)
138138
rdoc (>= 4.0.0)
139139
reline (>= 0.4.2)
140-
json (2.7.2)
140+
json (2.8.1)
141141
kgio (2.11.4)
142142
localhost (1.3.1)
143143
logger (1.6.1)
@@ -172,11 +172,7 @@ GEM
172172
racc (~> 1.4)
173173
nokogiri (1.16.7-x86_64-linux)
174174
racc (~> 1.4)
175-
oj (3.16.6)
176-
bigdecimal (>= 3.0)
177-
ostruct (>= 0.2)
178175
openssl (3.2.0)
179-
ostruct (0.6.0)
180176
pg (1.5.8)
181177
process-metrics (0.3.0)
182178
console (~> 1.8)
@@ -275,7 +271,6 @@ PLATFORMS
275271
DEPENDENCIES
276272
agoo
277273
falcon (~> 0.47)
278-
oj (~> 3.16)
279274
pg (~> 1.5)
280275
puma (~> 6.4)
281276
rackup

frameworks/Ruby/rails/app/controllers/json_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ class JsonController < ApplicationControllerMetal
44
def index
55
add_headers
66
self.content_type = 'application/json'
7-
self.response_body = Oj.dump({ 'message' => 'Hello, World!' })
7+
self.response_body = { 'message' => 'Hello, World!' }.to_json
88
end
99
end

frameworks/Ruby/rails/config/initializers/oj.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)