Skip to content

Fix performance of DPF vector #2249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

cbellot000
Copy link
Contributor

@cbellot000 cbellot000 commented Apr 30, 2025

closing #2201

DPF vector became slow because they were always checking if the modification of the vector by

  1. making a deep copy of the vector
  2. comparing the whole vector

Why performance changed between 0.13.6 and master?
Before 0.13.7.dev, it was hard coded that in process dpf vector wouldn't "check modification" and though bypassed dpf server logic. 0.13.7.dev is now relying on DPF server logic for updating or not dpf vector.

Proposed fixes

  • DPFVector are now always "committed" to dpf server whether they have been modified or not (as checking for modification is very slow)
  • Performance is highly improved for server version checks by caching previous checks

Benchmark
Test is taken for #2201, changing params are:

  • pydpf-core version
  • server types: in process/gRPC
  • vector operations: data is only "gotten", or data is "gotten" and "set"
Server type Vec operation 0.13.6 0.13.7.dev
In Process Get 0.009 s 0.008 s
In Process Get/Set 0.012 s 0.011 s
gRPC Get 6.608 s 3.773 s
gRPC Get/Set 8.707 s 3.707 s

@cbellot000 cbellot000 requested a review from a team as a code owner April 30, 2025 09:30
@cbellot000 cbellot000 linked an issue Apr 30, 2025 that may be closed by this pull request
3 tasks
Copy link

codecov bot commented Apr 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.03%. Comparing base (eb9035f) to head (748b4df).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2249      +/-   ##
==========================================
+ Coverage   84.01%   84.03%   +0.02%     
==========================================
  Files          90       90              
  Lines       10308    10316       +8     
==========================================
+ Hits         8660     8669       +9     
+ Misses       1648     1647       -1     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance of get/set field data
1 participant