Sha256: 1bf9c8367b57c6ab68657c807a4f04fc1bfc4440ee755fd1b32ebea7adcf8e60

Contents?: true

Size: 1.26 KB

Versions: 136

Compression:

Stored size: 1.26 KB

Contents

# Advanced Features

Optimized JSON (Oj), as the name implies, was written to provide speed optimized
JSON handling. It was designed as a faster alternative to Yajl and other
common Ruby JSON parsers. So far it has achieved that, and is about 2 times faster
than any other Ruby JSON parser, and 3 or more times faster at serializing JSON.

Oj has several `dump` or serialization modes which control how Ruby `Object`s are
converted to JSON. These modes are set with the `:mode` option in either the
default options or as one of the options to the `dump` method. In addition to
the various options there are also alternative APIs for parsing JSON.

The fastest alternative parser API is the `Oj::Doc` API. The `Oj::Doc` API takes
a completely different approach by opening a JSON document and providing calls
to navigate around the JSON while it is open. With this approach, JSON access
can be well over 20 times faster than conventional JSON parsing.

The `Oj::Saj` and `Oj::ScHandler` APIs are callback parsers that
walk the JSON document depth first and makes callbacks for each element.
Both callback parser are useful when only portions of the JSON are of
interest. Performance up to 20 times faster than conventional JSON is
possible if only a few elements of the JSON are of interest.

Version data entries

136 entries across 136 versions & 3 rubygems

Version Path
oj-3.13.20 pages/Advanced.md
oj-3.13.19 pages/Advanced.md
oj-3.13.18 pages/Advanced.md
oj-3.13.17 pages/Advanced.md
oj-3.13.16 pages/Advanced.md
oj-3.13.15 pages/Advanced.md
oj-3.13.14 pages/Advanced.md
oj-3.13.13 pages/Advanced.md
oj-3.13.12 pages/Advanced.md
oj-3.13.11 pages/Advanced.md
oj-3.13.10 pages/Advanced.md
oj-3.13.9 pages/Advanced.md
oj-3.13.8 pages/Advanced.md
oj-3.13.7 pages/Advanced.md
oj-3.13.6 pages/Advanced.md
oj-3.13.5 pages/Advanced.md
oj-3.13.4 pages/Advanced.md
oj-3.13.3 pages/Advanced.md
oj-3.13.2 pages/Advanced.md
oj-3.13.1 pages/Advanced.md