Skip to content

Commit

Permalink
Merge pull request #47 from alphagov/oj
Browse files Browse the repository at this point in the history
Use `oj` for faster JSON handling
  • Loading branch information
csutter authored Oct 9, 2023
2 parents 1fb6f34 + 9246d73 commit df90b18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ gem "railties", RAILS_GEMS_VERSION

gem "bootsnap", require: false
gem "govuk_app_config"
gem "oj"

# Gems specific to the document sync worker that aren't required for the main Rails API app
group :document_sync_worker do
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ GEM
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
oj (3.16.1)
opentelemetry-api (1.2.3)
opentelemetry-common (0.20.0)
opentelemetry-api (~> 1.0)
Expand Down Expand Up @@ -433,6 +434,7 @@ DEPENDENCIES
govuk_message_queue_consumer
govuk_test
jsonpath
oj
plek
railties (= 7.0.7.2)
rspec-rails
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/json.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Use Oj for faster JSON handling across the app
Oj.default_options = { mode: :rails }
Oj.optimize_rails

0 comments on commit df90b18

Please sign in to comment.