feat: Cache get_any_feature_view results by sebastjaeger · Pull Request #5175 · feast-dev/feast
What this PR does / why we need it:
Profiling indicates that a large amount of time is spent in creating features views from the protobuf representations for every call to the online feature retrieval interfaces.
In our testing setup where features are retrieved from 24 features views, 80%+ of the time spent in Feast excluding networking operations is due to the above. On my local machine (M2 Mac), this time can exceed 15ms.
This PR introduces a decorator that caches the results of get_any_feature_view, which will remove the need to call FeatureView.from_proto in many cases when retrieving online features.
In principle, the decorator could also be used for other functions such as get_feature_view.