https://github.com/ohler55/oj
Optimized JSON
https://github.com/ohler55/oj
Keywords
c json json-parser marshaller oj-gem rails ruby ruby-json-parser
Keywords from Contributors
activerecord mvc activejob rubygems rack rubocop rspec ruby-gem static-code-analysis code-formatter
Last synced: about 14 hours ago
JSON representation
Repository metadata
Optimized JSON
- Host: GitHub
- URL: https://github.com/ohler55/oj
- Owner: ohler55
- License: mit
- Created: 2012-02-17T09:30:32.000Z (about 14 years ago)
- Default Branch: develop
- Last Pushed: 2026-02-14T03:02:11.000Z (17 days ago)
- Last Synced: 2026-02-24T01:47:19.756Z (8 days ago)
- Topics: c, json, json-parser, marshaller, oj-gem, rails, ruby, ruby-json-parser
- Language: C
- Homepage: http://www.ohler.com/oj
- Size: 5.38 MB
- Stars: 3,200
- Watchers: 36
- Forks: 261
- Open Issues: 14
- Releases: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
README.md
gem
A fast JSON parser and Object marshaller as a Ruby gem.
Version 3.13 is out with a much faster parser (Oj::Parser) and option isolation.
Using
require 'oj'
h = { 'one' => 1, 'array' => [ true, false ] }
json = Oj.dump(h)
# json =
# {
# "one":1,
# "array":[
# true,
# false
# ]
# }
h2 = Oj.load(json)
puts "Same? #{h == h2}"
# true
Installation
gem install oj
or in Bundler:
gem 'oj'
Rails and json quickstart
See the Quickstart sections of the Rails and json docs.
multi_json
Code which uses multi_json
will automatically prefer Oj if it is installed.
Support
Get supported Oj with a Tidelift Subscription. Security updates are supported.
Further Reading
For more details on options, modes, advanced features, and more follow these
links.
- {file:Options.md} for parse and dump options.
- {file:Modes.md} for details on modes for strict JSON compliance, mimicking the JSON gem, and mimicking Rails and ActiveSupport behavior.
- {file:JsonGem.md} includes more details on json gem compatibility and use.
- {file:Rails.md} includes more details on Rails and ActiveSupport compatibility and use.
- {file:Custom.md} includes more details on Custom mode.
- {file:Encoding.md} describes the :object encoding format.
- {file:Compatibility.md} lists current compatibility with Rubys and Rails.
- {file:Advanced.md} for fast parser and marshalling features.
- {file:Security.md} for security considerations.
- {file:InstallOptions.md} for install option.
Releases
See {file:CHANGELOG.md} and {file:RELEASE_NOTES.md}
Links
-
Documentation: http://www.ohler.com/oj/doc, http://rubydoc.info/gems/oj
-
GitHub repo: https://github.com/ohler55/oj
-
RubyGems repo: https://rubygems.org/gems/oj
Follow @peterohler on Twitter for announcements and news about the Oj gem.
Performance Comparisons
-
Oj Strict Mode Performance compares Oj strict mode parser performance to other JSON parsers.
-
Oj Compat Mode Performance compares Oj compat mode parser performance to other JSON parsers.
-
Oj Object Mode Performance compares Oj object mode parser performance to other marshallers.
-
Oj Callback Performance compares Oj callback parser performance to other JSON parsers.
Links of Interest
-
Fast XML parser and marshaller on RubyGems: https://rubygems.org/gems/ox
-
Fast XML parser and marshaller on GitHub: https://github.com/ohler55/ox
-
Need for Speed for an overview of how Oj::Doc was designed.
-
OjC, a C JSON parser: https://www.ohler.com/ojc also at https://github.com/ohler55/ojc
-
Agoo, a high performance Ruby web server supporting GraphQL on GitHub: https://github.com/ohler55/agoo
-
Agoo-C, a high performance C web server supporting GraphQL on GitHub: https://github.com/ohler55/agoo-c
-
oj-introspect, an example of creating an Oj parser extension in C: https://github.com/meinac/oj-introspect
Contributing
- Provide a Pull Request off the
developbranch. - Report a bug
- Suggest an idea
- Code is now formatted with the clang-format tool with the configuration file in the root of the repo.
Owner metadata
- Name: Peter Ohler
- Login: ohler55
- Email: peter@ohler.com
- Kind: user
- Description:
- Website: http://www.ohler.com
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/118856?u=c9a1585bec9895d5cbe167ce2780362612ca7aac&v=4
- Repositories: 41
- Last ynced at: 2026-01-29T23:18:58.022Z
- Profile URL: https://github.com/ohler55
GitHub Events
Total
- Release event: 1
- Delete event: 11
- Pull request event: 52
- Fork event: 10
- Issues event: 23
- Watch event: 63
- Issue comment event: 114
- Push event: 64
- Pull request review comment event: 22
- Pull request review event: 45
- Create event: 12
Last Year
- Delete event: 10
- Pull request event: 25
- Fork event: 3
- Issues event: 15
- Watch event: 32
- Issue comment event: 87
- Push event: 42
- Pull request review comment event: 16
- Pull request review event: 28
- Create event: 7
Committers metadata
Last synced: 3 days ago
Total Commits: 1,447
Total Committers: 133
Avg Commits per committer: 10.88
Development Distribution Score (DDS): 0.236
Commits in past year: 35
Committers in past year: 6
Avg Commits per committer in past year: 5.833
Development Distribution Score (DDS) in past year: 0.4
| Name | Commits | |
|---|---|---|
| Peter Ohler | p****r@o****m | 1105 |
| Watson | w****8@g****m | 77 |
| yui-knk | s****a@g****m | 21 |
| Nick Schonning | n****i@g****m | 12 |
| Dmitry Krasnoukhov | d****y@k****m | 10 |
| Stan Hu | s****u@g****m | 9 |
| Ville Lautanala | l****s@g****m | 8 |
| stereobooster | s****r@g****m | 8 |
| Anton Rieder | 1****r | 7 |
| Scott Myron | s****n@g****m | 7 |
| dependabot[bot] | 4****] | 7 |
| Alastair Surin | a****n@g****m | 6 |
| David Chelimsky | d****y@g****m | 5 |
| Ulysse Buonomo | b****e@g****m | 5 |
| Kurtis Rainbolt-Greene | me@k****e | 5 |
| Duncan MacGregor | d****r@o****m | 4 |
| Jean byroot Boussier | j****b@s****m | 4 |
| Andrew Kuklewicz | a****w@b****m | 3 |
| Chulki Lee | c****e@g****m | 3 |
| Ian Ker-Seymer | i****r@g****m | 3 |
| Stefan Kaes | s****s@x****m | 3 |
| Peter Winton | p****n@i****m | 2 |
| Omer Katz | o****w@g****m | 2 |
| Olle Jonsson | o****n@g****m | 2 |
| Nobuyoshi Nakada | n****u@r****g | 2 |
| Naveen | 1****n | 2 |
| Matthias Luedtke | m****e@d****e | 2 |
| MSP-Greg | M****g | 2 |
| Jean Boussier | j****r@g****m | 2 |
| Brad Bicknell | f****f@g****m | 2 |
| and 103 more... | ||
Committer domains:
- shopify.com: 2
- yandex.ru: 2
- ruby-lang.org: 2
- gocardless.com: 1
- dataeverywhere.com: 1
- backhub.co: 1
- gaurishsharma.com: 1
- antiflux.org: 1
- idaemons.org: 1
- tanda.co: 1
- andrepiske.me: 1
- ekenosen.net: 1
- rudi-horn.de: 1
- yandex.ua: 1
- lightspeedretail.com: 1
- intercom.io: 1
- benjaminfleischer.com: 1
- dynport.de: 1
- indigobio.com: 1
- xing.com: 1
- beginsinwonder.com: 1
- oracle.com: 1
- kurtisrainboltgreene.name: 1
- krasnoukhov.com: 1
- rhe.jp: 1
- laverse.net: 1
- cs.stanford.edu: 1
- qslw.com: 1
- doorkeeper.jp: 1
- users.sourceforge.jp: 1
- pagerduty.com: 1
- voxmedia.com: 1
- kjtsanaktsidis.id.au: 1
- peterzhu.ca: 1
- paralaus.com: 1
- yukinishijima.net: 1
- twistbioscience.com: 1
- tiscali.it: 1
- hey.com: 1
- capita.de: 1
- teoljungberg.com: 1
- moo.gl: 1
- schilling.io: 1
- oneofthem.jp: 1
- seven.(none): 1
- flowdock.com: 1
- me.com: 1
- ohler.com: 1
Issue and Pull Request metadata
Last synced: 3 days ago
Total issues: 82
Total pull requests: 179
Average time to close issues: 7 months
Average time to close pull requests: 26 days
Total issue authors: 76
Total pull request authors: 34
Average comments per issue: 5.29
Average comments per pull request: 2.07
Merged pull request: 136
Bot issues: 0
Bot pull requests: 13
Past year issues: 15
Past year pull requests: 33
Past year average time to close issues: 21 days
Past year average time to close pull requests: 14 days
Past year issue authors: 15
Past year pull request authors: 8
Past year average comments per issue: 5.53
Past year average comments per pull request: 2.27
Past year merged pull request: 21
Past year bot issues: 0
Past year bot pull requests: 6
Top Issue Authors
- copiousfreetime (3)
- fnordfish (2)
- gschlager (2)
- KJTsanaktsidis (2)
- semaperepelitsa (2)
- DaniilMusinCallibri (1)
- carlhoerberg (1)
- bquorning (1)
- pjb3 (1)
- obrie (1)
- mrbongiolo (1)
- wlokes (1)
- jasonpenny (1)
- okuramasafumi (1)
- lioneldebauge (1)
Top Pull Request Authors
- Watson1978 (55)
- nschonni (18)
- samyron (15)
- ohler55 (14)
- dependabot[bot] (13)
- stanhu (11)
- byroot (6)
- aardvark179 (4)
- meinac (4)
- jscheid (4)
- andrykonchin (2)
- ybiquitous (2)
- sebyx07 (2)
- copiousfreetime (2)
- teoljungberg (2)
Top Issue Labels
Top Pull Request Labels
- dependencies (13)
- github_actions (6)
Package metadata
- Total packages: 2
-
Total downloads:
- rubygems: 552,849,218 total
- Total docker downloads: 3,347,666,482
- Total dependent packages: 965 (may contain duplicates)
- Total dependent repositories: 13,067 (may contain duplicates)
- Total versions: 580
- Total maintainers: 1
gem.coop: oj
The fastest JSON parser and object serializer.
- Homepage: http://www.ohler.com/oj/
- Documentation: http://www.rubydoc.info/gems/oj/
- Licenses: MIT
- Latest release: 3.16.15 (published 26 days ago)
- Last Synced: 2026-02-28T17:01:03.558Z (3 days ago)
- Versions: 290
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 276,413,237 Total
- Docker Downloads: 1,673,833,241
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.031%
- Downloads: 0.092%
- Maintainers (1)
rubygems.org: oj
The fastest JSON parser and object serializer.
- Homepage: http://www.ohler.com/oj/
- Documentation: http://www.rubydoc.info/gems/oj/
- Licenses: MIT
- Latest release: 3.16.15 (published 26 days ago)
- Last Synced: 2026-03-01T04:32:29.362Z (2 days ago)
- Versions: 290
- Dependent Packages: 965
- Dependent Repositories: 13,067
- Downloads: 276,435,981 Total
- Docker Downloads: 1,673,833,241
-
Rankings:
- Dependent packages count: 0.05%
- Docker downloads count: 0.081%
- Downloads: 0.092%
- Dependent repos count: 0.302%
- Average: 0.484%
- Stargazers count: 0.647%
- Forks count: 1.731%
- Maintainers (1)
Dependencies
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
- minitest ~> 5 development
- rake-compiler >= 0.9, < 2.0 development
- test-unit ~> 3.0 development
- actions/checkout v3 composite
- jidicula/clang-format-action v4.11.0 composite
- minitest ~> 5 development
- rake-compiler >= 0.9, < 2.0 development
- rubocop ~> 1.47 development
- rubocop-minitest ~> 0.28.0 development
- test-unit ~> 3.0 development
- actions/checkout v3 composite
- r7kamura/rubocop-problem-matchers-action v1 composite
- ruby/setup-ruby v1 composite
Score: 35.04999924891746