Skip to content

perf: Optimize protobuf parsing in Redis online store#6023

Merged
ntkathole merged 3 commits intofeast-dev:masterfrom
abhijeet-dhumal:perf/optimize-redis-protobuf-parsing
Mar 2, 2026
Merged

perf: Optimize protobuf parsing in Redis online store#6023
ntkathole merged 3 commits intofeast-dev:masterfrom
abhijeet-dhumal:perf/optimize-redis-protobuf-parsing

Conversation

@abhijeet-dhumal
Copy link
Contributor

@abhijeet-dhumal abhijeet-dhumal commented Feb 25, 2026

Summary

Optimize protobuf deserialization in the Redis online store to reduce latency in the feature retrieval hot path.

Changes

  • Avoid redundant bytes() conversion when data is already bytes type (Redis returns bytes)
  • Use list comprehension for more efficient batch conversion in _convert_redis_values_to_protobuf
  • Add return type annotation for better code clarity
  • Remove unnecessary else clause for cleaner control flow

Expected Behavior

Protobuf deserialization should skip unnecessary type conversions when data is already in the correct format.

Current Behavior

The code unconditionally calls bytes() on every value, even when the data is already bytes. For 50 entities × 200 features = 10,000 unnecessary conversion checks per request.

Performance Impact

  • Estimated savings: 2-5ms per request for typical workloads
  • Validated via: cProfile analysis of ParseFromString cumulative time

Steps to Reproduce

  1. Set up a Redis online store with a feature view containing 200 features
  2. Run get_online_features for 50 entities
  3. Profile with cProfile and observe ParseFromString overhead

Specifications

  • Version: 0.47.0+
  • Platform: All
  • Subsystem: sdk/python/feast/infra/online_stores/redis.py

Related

  • RHOAIENG-46061 (60ms p99 SLA target for online feature serving)

Open with Devin

@abhijeet-dhumal abhijeet-dhumal requested a review from a team as a code owner February 25, 2026 14:40
@abhijeet-dhumal abhijeet-dhumal changed the title perf: optimize protobuf parsing in Redis online store perf: Optimize protobuf parsing in Redis online store Feb 25, 2026
@abhijeet-dhumal abhijeet-dhumal force-pushed the perf/optimize-redis-protobuf-parsing branch from 0f5fc75 to b6d8f45 Compare February 25, 2026 14:43
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 findings.

Open in Devin Review

@abhijeet-dhumal abhijeet-dhumal force-pushed the perf/optimize-redis-protobuf-parsing branch from a4de037 to f9802b1 Compare March 2, 2026 06:10
@ntkathole ntkathole force-pushed the perf/optimize-redis-protobuf-parsing branch from f9802b1 to 5921645 Compare March 2, 2026 06:46
Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
@ntkathole ntkathole force-pushed the perf/optimize-redis-protobuf-parsing branch from 5921645 to e0503cc Compare March 2, 2026 10:52
@ntkathole ntkathole merged commit 59dfdb8 into feast-dev:master Mar 2, 2026
16 of 23 checks passed
franciscojavierarceo pushed a commit that referenced this pull request Mar 10, 2026
# [0.61.0](v0.60.0...v0.61.0) (2026-03-10)

### Bug Fixes

* Add grpcio dependency group to transformation server Dockerfile ([2c2150a](2c2150a))
* Add https readiness check for rest-registry tests ([ea85e63](ea85e63))
* Add website build check for PRs and fix blog frontmatter YAML error ([#6079](#6079)) ([30a3a43](30a3a43))
* Added MLflow metric charts across feature selection ([#6080](#6080)) ([a403361](a403361))
* Check duplicate names for feature view across types ([#5999](#5999)) ([95b9af8](95b9af8))
* Fix integration tests ([#6046](#6046)) ([02d5548](02d5548))
* Fix non-specific label selector on metrics service ([a1a160d](a1a160d))
* Fixed IntegrityError on SqlRegistry ([#6047](#6047)) ([325e148](325e148))
* Fixed pre-commit check ([114b7db](114b7db))
* Fixed uv cache permission error for docker build on mac ([ad807be](ad807be))
* Fixes a `PydanticDeprecatedSince20` warning for trino_offline_store ([#5991](#5991)) ([abfd18a](abfd18a))
* Integration test failures ([#6040](#6040)) ([9165870](9165870))
* Ray offline store tests are duplicated across 3 workflows ([54f705a](54f705a))
* Reenable tests ([#6036](#6036)) ([82ee7f8](82ee7f8))
* Use commitlint pre-commit hook instead of a separate action ([35a81e7](35a81e7))

### Features

* Add complex type support (Map, JSON, Struct) with schema validation ([#5974](#5974)) ([1200dbf](1200dbf))
* Add materialization, feature freshness, request latency, and push metrics to feature server ([2c6be18](2c6be18))
* Add non-entity retrieval support for ClickHouse offline store ([4d08ddc](4d08ddc)), closes [#5835](#5835)
* Add OnlineStore for MongoDB ([#6025](#6025)) ([bf4e3fa](bf4e3fa)), closes [golang/go#74462](golang/go#74462)
* Added CodeQL SAST scanning and detect-secrets pre-commit hook ([547b516](547b516))
* Adding optional name to Aggregation (feast-dev[#5994](#5994)) ([#6083](#6083)) ([56469f7](56469f7))
* Feature Server High-Availability on Kubernetes ([#6028](#6028)) ([9c07b4c](9c07b4c)), closes [Hi#Availability](https://github.com/Hi/issues/Availability) [Hi#Availability](https://github.com/Hi/issues/Availability)
* **go:** Implement metrics and tracing for http and grpc servers ([#5925](#5925)) ([2b4ec9a](2b4ec9a))
* Horizontal scaling support to the Feast operator ([#6000](#6000)) ([3ec13e6](3ec13e6))
* Making feature view source optional (feast-dev[#6074](#6074)) ([#6075](#6075)) ([76917b7](76917b7))
* Support arm docker build ([#6061](#6061)) ([1e1f5d9](1e1f5d9))
* Use orjson for faster JSON serialization in feature server ([6f5203a](6f5203a))

### Performance Improvements

* Optimize protobuf parsing in Redis online store ([#6023](#6023)) ([59dfdb8](59dfdb8))
* Optimize timestamp conversion in _convert_rows_to_protobuf ([33a2e95](33a2e95))
* Parallelize DynamoDB batch reads in sync online_read ([#6024](#6024)) ([9699944](9699944))
* Remove redundant entity key serialization in online_read ([d87283f](d87283f))
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