Skip to content

feat: Use ORJSONResponse for faster JSON serialization in feature server#5930

Open
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
ntkathole:orjson
Open

feat: Use ORJSONResponse for faster JSON serialization in feature server#5930
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
ntkathole:orjson

Conversation

@ntkathole
Copy link
Member

@ntkathole ntkathole commented Feb 1, 2026

What this PR does / why we need it:

This PR improves the latency of the online feature server by using FastAPI's built-in ORJSONResponse instead of the default JSONResponse. This leverages orjson, a fast JSON library written in Rust, for response serialization.

Changes

  • Added orjson>=3.9.0 as a core dependency (required by ORJSONResponse)
  • Modified /get-online-features and /retrieve-online-documents endpoint to return ORJSONResponse

When returning a dict from a FastAPI endpoint, FastAPI uses Python's standard json module for serialization. By using ORJSONResponse, we leverage orjson which is written in Rust and provides significantly faster JSON encoding.


Open with Devin

@ntkathole ntkathole self-assigned this Feb 1, 2026
@ntkathole ntkathole requested a review from a team as a code owner February 1, 2026 15:48
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional flags.

Open in Devin Review

Copy link
Member

@franciscojavierarceo franciscojavierarceo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to get tests passing but approving to unblock

@ntkathole
Copy link
Member Author

Need to get tests passing but approving to unblock

@franciscojavierarceo Test failures are due to transient dependency sqlglot, related to ibis-project/ibis#11882.

I have handled it already in #5928 , will rebase this PR once it's merged.

devin-ai-integration[bot]

This comment was marked as resolved.

Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants