GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [perf] Replace MessageToDict with optimized custom dict builder - 4x faster JSON serialization · Issue #6013 · feast-dev/feast

[perf] Replace MessageToDict with optimized custom dict builder - 4x faster JSON serialization #6013

New issue
Copy link
New issue
Copy link
Closed
#6015
Closed
[perf] Replace MessageToDict with optimized custom dict builder - 4x faster JSON serialization#6013
#6015
Copy link
Assignees
abhijeet-dhumal
Labels
kind/bugpriority/p2

Description

@abhijeet-dhumal
abhijeet-dhumal
opened on Feb 24, 2026
Issue body actions

Current Behavior

The feature server's /get-online-features endpoint uses google.protobuf.json_format.MessageToDict to convert protobuf responses to JSON. MessageToDict is a generic converter designed for any protobuf type, but for the known GetOnlineFeaturesResponse structure, a type-specific converter is 4x faster.

Steps to reproduce

  • Deploy Feast feature server to Kubernetes
  • Call /get-online-features with 100 entities and 50 features
  • Profile the endpoint and isolate MessageToDict time
  • Observe ~12ms spent in MessageToDict (98% of serialization time)
  • Compare with proto binary serialization which takes only 0.1ms
  • Implement custom dict builder and observe 2.9ms (4x improvement)

Specifications

  • Feast version: 0.60.0
  • Python version: 3.11
  • Tested on: OpenShift/Kubernetes with Redis, PostgreSQL, DynamoDB

Benchmark Results

Tested with 100 entities, 50 features in-cluster:

Current (MessageToDict + orjson):  12.0ms
- MessageToDict only:            11.8ms  (98% of time!)
- orjson (dict→JSON):             0.2ms

Custom dict builder + orjson:       2.9ms
-  Custom builder:                 2.7ms
-  orjson (dict→JSON):             0.2ms

Proto binary (for comparison):      0.1ms

Why MessageToDict is Slow

  • Reflection-based field discovery for ANY protobuf message
  • Dynamic type checking for each field
  • Generic handling of all value types (oneofs, repeated, maps)
  • CamelCase/snake_case conversion logic
  • For GetOnlineFeaturesResponse, we know the exact schema, so all this reflection is unnecessary.

Possible Solution

Add sdk/python/feast/feature_server_utils.py with a custom dict builder

Metric Before After Improvement
Serialization (100 entities) 12.0ms 2.9ms 4.1x faster
Serialization (500 entities) ~55ms ~13ms 4.2x faster

Activity

  1. abhijeet-dhumal
    added
    kind/bug
    priority/p2
    on Feb 24, 2026
  2. abhijeet-dhumal commented on Feb 24, 2026

    @abhijeet-dhumal
    abhijeet-dhumal
    on Feb 24, 2026
    ContributorAuthor
    More actions

    @ntkathole @franciscojavierarceo
    Hey guys, may i request your opinion on this ?

  3. abhijeet-dhumal
    added 7 commits that reference this issue on Feb 24, 2026

    [perf] Replace MessageToDict with optimized custom dict builder

    This issue will close once commit 8254e03 is merged into the 'master' branch.
    8254e03

    [perf] Replace MessageToDict with optimized custom dict builder

    This issue will close once commit ec333c4 is merged into the 'master' branch.
    ec333c4

    [perf] Replace MessageToDict with optimized custom dict builder

    This issue will close once commit ddf4f97 is merged into the 'master' branch.
    ddf4f97

    [perf] Replace MessageToDict with optimized custom dict builder

    This issue will close once commit 865313e is merged into the 'master' branch.
    865313e

    [perf] Replace MessageToDict with optimized custom dict builder

    This issue will close once commit 6e4b59a is merged into the 'master' branch.
    6e4b59a

    [perf] Replace MessageToDict with optimized custom dict builder

    This issue will close once commit 6a38f3c is merged into the 'master' branch.
    6a38f3c

    [perf] Replace MessageToDict with optimized custom dict builder

    This issue will close once commit 2b81774 is merged into the 'master' branch.
    2b81774
  4. ntkathole
    assigned
    abhijeet-dhumal
    on Feb 25, 2026
  5. abhijeet-dhumal
    added a commit that references this issue on Feb 25, 2026

    perf: Replace MessageToDict with optimized custom dict builder

    This issue will close once commit d3c512d is merged into the 'master' branch.
    d3c512d
  6. franciscojavierarceo
    closed this as completedin #6015on May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @abhijeet-dhumal
    abhijeet-dhumal

Labels

kind/bugpriority/p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.