Title: performance issues of getting online features related to parsing protobuf data · Issue #3649 · feast-dev/feast · GitHub
Open Graph Title: performance issues of getting online features related to parsing protobuf data · Issue #3649 · feast-dev/feast
X Title: performance issues of getting online features related to parsing protobuf data · Issue #3649 · feast-dev/feast
Description: Is your feature request related to a problem? Please describe. The profiler of one application I am working on shows the from_proto method of the FeatureView class takes up 80% of the execution time. The result of cProfile is shown below...
Open Graph Description: Is your feature request related to a problem? Please describe. The profiler of one application I am working on shows the from_proto method of the FeatureView class takes up 80% of the execution tim...
X Description: Is your feature request related to a problem? Please describe. The profiler of one application I am working on shows the from_proto method of the FeatureView class takes up 80% of the execution tim...
Opengraph URL: https://github.com/feast-dev/feast/issues/3649
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"performance issues of getting online features related to parsing protobuf data","articleBody":"**Is your feature request related to a problem? Please describe.**\r\n\r\nThe profiler of one application I am working on shows the `from_proto` method of the `FeatureView` class takes up 80% of the execution time. The result of cProfile is shown below.\r\n```\r\n ncalls tottime percall cumtime percall filename:lineno(function)\r\n 1 0.003 0.003 78.931 78.931 profiler.py:53(main)\r\n 100 0.018 0.000 78.849 0.788 get_features.py:122(get_xxxx_features)\r\n 1100/400 0.020 0.000 77.077 0.193 usage.py:274(wrapper)\r\n 444200/9800 1.713 0.000 72.206 0.007 __init__.py:1030(wrapper)\r\n 200 0.078 0.000 68.913 0.345 feature_store.py:1527(get_online_features)\r\n 200 0.087 0.000 68.835 0.344 feature_store.py:1590(_get_online_features)\r\n 3500 5.634 0.002 62.442 0.018 feature_view.py:369(from_proto)\r\n 200 0.005 0.000 59.362 0.297 feature_store.py:2149(_get_feature_views_to_use)\r\n 200 0.002 0.000 58.501 0.293 feature_store.py:281(_list_feature_views)\r\n 200 0.001 0.000 58.499 0.292 registry.py:523(list_feature_views)\r\n 200 0.016 0.000 58.495 0.292 proto_registry_utils.py:150(list_feature_views)\r\n```\r\nThere are 3 feature views accessed by `get_xxxx_features`, however 100 calls of `get_xxxx_features` lead to 3500 calls of `from_proto`. There are 17 feature views in the feature store of this application and 3 of them are used by `get_xxxx_features`.\r\n\r\nEnvironment: `continuumio/miniconda3:4.11.0` (linux/amd64) base image, `python==3.9.7`, `feast=0.31.1`, `protobuf==4.23.2`\r\n\r\n**Describe the solution you'd like**\r\n\r\nInstead of caching the protobuf blob of `FeatureView`, cache the `FeatureView` python object in memory.\r\n\r\n**Describe alternatives you've considered**\r\n\r\nmodify the `get_online_features` [method](https://github.com/feast-dev/feast/blob/v0.31.1/sdk/python/feast/feature_store.py#L1528) to\r\n```python\r\ndef get_online_features(\r\n self,\r\n features: Union[List[str], List[FeatureView], FeatureService],\r\n entity_rows: List[Dict[str, Any]],\r\n full_feature_names: bool = False,\r\n):\r\n``` \r\nso that the application developer has the option to cache the `FeatureView` objects and use them to get features directly (by passing the `get_feature_views_to_use` [step](https://github.com/feast-dev/feast/blob/v0.31.1/sdk/python/feast/feature_store.py#L1606-L1613) )\r\n ","author":{"url":"https://github.com/heavenmarshal","@type":"Person","name":"heavenmarshal"},"datePublished":"2023-06-12T13:41:56Z","url":"https://github.com/feast-dev/feast/issues/3649"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e82e4d70-3c6f-2dc1-8b81-959f00940dcd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9530:10CB0:F6FDB5:144E717:6AFE99A6 |
| html-safe-nonce | 828cbd99218bc8ad10380e336f82920534b590829333ec790aa5f580deb2bd65 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTMwOjEwQ0IwOkY2RkRCNToxNDRFNzE3OjZBRkU5OUE2IiwidmlzaXRvcl9pZCI6IjUzNDY2NjEyNDIxODg1MDM0NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f16219e2274e57e365c2a5e075e4aa530d8119919550b1db1f1dd385a5bc36ba |
| hovercard-subject-tag | issue:1752797109 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/3649/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2a1d1a1e50b758ec1aa7e630136105b9fc568e4b560925a1277be99361237608/feast-dev/feast/issues/3649 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2a1d1a1e50b758ec1aa7e630136105b9fc568e4b560925a1277be99361237608/feast-dev/feast/issues/3649 |
| og:image:alt | Is your feature request related to a problem? Please describe. The profiler of one application I am working on shows the from_proto method of the FeatureView class takes up 80% of the execution tim... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | heavenmarshal |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width