Skip to content

Conversation

@VerdantForge
Copy link

@VerdantForge VerdantForge commented Dec 10, 2025

orjson allows for blazing fast serialization/deserialization of json in python. applying this to save_as_json allows us to save an incredible 50ms on some documents (25% serialization time reduction).

fixes: #451

BREAKING_CHANGES:

  • no indentation other than 2
  • no ensure_ascii option, we can only write utf-8

@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2025

DCO Check Passed

Thanks @VerdantForge, all your commits are properly signed off. 🎉

@mergify
Copy link

mergify bot commented Dec 10, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 Require two reviewer for test updates

This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@dosubot
Copy link

dosubot bot commented Dec 10, 2025

Related Documentation

Checked 7 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@Artolomeus Artolomeus force-pushed the faster-json-serialization-through-orjson branch from 7594d33 to 9890b37 Compare December 11, 2025 09:40
In the DoclingDocument classn 25% speed gain on json serialization through orjson.

BREAKING CHANGE: orjson replaces indent option by  option=orjson.OPT_INDENT_2 and only supports indent 2.

BREAKING CHANGE: orjson drops ensure_ascii option and cannot escape UTF-8 to ASCII

Signed-off-by: Nicholas Greensmith <[email protected]>
@Artolomeus Artolomeus force-pushed the faster-json-serialization-through-orjson branch from 9890b37 to 5b83903 Compare December 11, 2025 09:47
@VerdantForge VerdantForge marked this pull request as draft December 11, 2025 10:15
@VerdantForge VerdantForge changed the title 25% speed gain on json serialization through orjson... perf: 25% speed gain on json serialization through orjson... Dec 11, 2025
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.

Consider orjson for faster JSON serialization / deserialization

1 participant