Skip to content

Add unique_keys option to parse/2 for faster lookups#19

Merged
lpgauth merged 2 commits intomainfrom
feat/unique-keys-option
Mar 28, 2026
Merged

Add unique_keys option to parse/2 for faster lookups#19
lpgauth merged 2 commits intomainfrom
feat/unique-keys-option

Conversation

@lpgauth
Copy link
Copy Markdown
Owner

@lpgauth lpgauth commented Mar 28, 2026

No description provided.

lpgauth added 2 commits March 27, 2026 21:16
When JSON is known to have no duplicate object keys, passing
unique_keys: true uses sonic-rs native indexing instead of a
reverse linear scan (rfind) for pointer lookups.

The flag is stored on the ParsedDocument at parse time so all
subsequent get/get_many/get_many_nil/length calls use the fast
path automatically. Benchmarks show ~15-17% improvement on
isolated get operations.

Also splits benchmarks into separate parse and get sections to
isolate lookup cost from parse cost, and updates benchmark
results.
Add docs/0 config to mix.exs with groups_for_docs to organize
functions into Decoding, Encoding, and Parse + Get sections.
Add doctests to every public function and a doctest runner.
Rewrite @moduledoc with type conversion table and structured
sections. Reorder functions to match their doc groups.
@lpgauth lpgauth merged commit f999cab into main Mar 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant