Skip to content

Comments

perf: Remove redundant entity key serialization in online_read#6006

Open
abhijeet-dhumal wants to merge 1 commit intofeast-dev:masterfrom
abhijeet-dhumal:perf/remove-redundant-entity-key-serialization
Open

perf: Remove redundant entity key serialization in online_read#6006
abhijeet-dhumal wants to merge 1 commit intofeast-dev:masterfrom
abhijeet-dhumal:perf/remove-redundant-entity-key-serialization

Conversation

@abhijeet-dhumal
Copy link

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

Summary

Removes redundant entity key serialization in online_read() for SQLite and Snowflake online stores.

Before: Entity keys were serialized twice - once for the query and again when iterating results
After: Pre-computed serialized_entity_keys list is reused

Changes

  • SQLite: Reuse serialized_entity_keys instead of re-calling serialize_entity_key() in result loop
  • Snowflake: Pre-compute serialized keys and reuse in both query building and result processing

Benchmark Results (SQLite)

Config Before After Improvement
50f × 100e 18.21ms 17.51ms 3.8% faster
50f × 500e 92.63ms 89.60ms 3.3% faster

Test Plan

  • Existing unit tests pass
  • Benchmarked before/after on SQLite
  • Snowflake changes follow same pattern (no Snowflake test env available)

Fixes #6005


Open with Devin

@abhijeet-dhumal abhijeet-dhumal requested a review from a team as a code owner February 23, 2026 08:39
@abhijeet-dhumal abhijeet-dhumal force-pushed the perf/remove-redundant-entity-key-serialization branch from e09e3ff to 49add6b Compare February 23, 2026 08:41
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 4 additional findings.

Open in Devin Review

@ntkathole ntkathole force-pushed the perf/remove-redundant-entity-key-serialization branch from 49add6b to 20ec3f0 Compare February 23, 2026 09:04
@abhijeet-dhumal abhijeet-dhumal force-pushed the perf/remove-redundant-entity-key-serialization branch from 9375456 to aa04d40 Compare February 23, 2026 09:43
@abhijeet-dhumal abhijeet-dhumal force-pushed the perf/remove-redundant-entity-key-serialization branch from 97db073 to 20b8e46 Compare February 23, 2026 10:07
+ ")"
)
for combo in itertools.product(entity_keys, requested_features)
for i, entity_key in enumerate(entity_keys)
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better if we do enumerate(serialized_entity_keys)

Copy link
Author

Choose a reason for hiding this comment

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

Thanks Nikhil for reviewing, Yeah that makes sense..
Even further instead of using enumerate I have used direct iteration now, as no index needed here ✅

Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
@abhijeet-dhumal abhijeet-dhumal force-pushed the perf/remove-redundant-entity-key-serialization branch from 20b8e46 to 4686562 Compare February 23, 2026 11:29
Copy link
Member

@ntkathole ntkathole left a comment

Choose a reason for hiding this comment

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

Lgtm

@abhijeet-dhumal
Copy link
Author

@franciscojavierarceo May I request your review here ?

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.

perf: Remove redundant entity key serialization in online_read for SQLite/MySQL/Snowflake

2 participants