Skip to content

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

Merged
ntkathole merged 1 commit into
feast-dev:masterfrom
ntkathole:orjson
Feb 23, 2026
Merged

feat: Use ORJSONResponse for faster JSON serialization in feature server#5930
ntkathole merged 1 commit into
feast-dev:masterfrom
ntkathole:orjson

Conversation

@ntkathole

@ntkathole ntkathole commented Feb 1, 2026

Copy link
Copy Markdown
Member

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

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

Copy link
Copy Markdown
Contributor

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

@franciscojavierarceo franciscojavierarceo left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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>
@ntkathole ntkathole merged commit 6f5203a into feast-dev:master Feb 23, 2026
18 of 20 checks passed
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