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,6 +1,5 @@
source 'https://rubygems.org'
-gem 'oj', '~> 3.16'
gem 'rails', '~> 7.2.0'
gem 'redis', '~> 5.0'
gem 'tzinfo-data'
@@ -137,7 +137,7 @@ GEM
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
- json (2.7.2)
+ json (2.8.1)
kgio (2.11.4)
localhost (1.3.1)
logger (1.6.1)
@@ -172,11 +172,7 @@ GEM
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
- oj (3.16.6)
- bigdecimal (>= 3.0)
- ostruct (>= 0.2)
openssl (3.2.0)
- ostruct (0.6.0)
pg (1.5.8)
process-metrics (0.3.0)
console (~> 1.8)
@@ -275,7 +271,6 @@ PLATFORMS
DEPENDENCIES
agoo
falcon (~> 0.47)
- oj (~> 3.16)
pg (~> 1.5)
puma (~> 6.4)
rackup
@@ -4,6 +4,6 @@ class JsonController < ApplicationControllerMetal
def index
add_headers
self.content_type = 'application/json'
- self.response_body = Oj.dump({ 'message' => 'Hello, World!' })
+ self.response_body = { 'message' => 'Hello, World!' }.to_json
end
@@ -1 +0,0 @@
-Oj.optimize_rails