Skip to content

[core] Limit the statistics number of observations#2985

Merged
cbentejac merged 1 commit intodevelopfrom
dev/statistics
Jan 23, 2026
Merged

[core] Limit the statistics number of observations#2985
cbentejac merged 1 commit intodevelopfrom
dev/statistics

Conversation

@servantftransperfect
Copy link
Copy Markdown
Contributor

This pull request updates the Statistics class in meshroom/core/stats.py to improve memory efficiency by limiting the number of stored data points and dynamically adjusting the sampling interval. The changes introduce a mechanism to filter and downsample collected statistics, ensuring that performance and memory usage remain stable over long-running sessions.

Data retention and interval management improvements:

  • Added a maxPoints parameter to the Statistics class to limit the number of stored data points and implemented logic in update to double the sampling interval and downsample the data when this limit is exceeded. [1] [2]
  • Introduced the _filterDataPoints method to efficiently downsample the times, computer.curves, and process.curves data structures when the maximum number of points is reached.
  • Added maxPoints and baseInterval attributes to the class, and included them in serialization (toDict) and deserialization (fromDict) to ensure persistence across sessions. [1] [2]

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 31.25000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.74%. Comparing base (cca5cc5) to head (fbc941e).
⚠️ Report is 25 commits behind head on develop.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/core/stats.py 31.25% 11 Missing ⚠️

❌ Your patch status has failed because the patch coverage (31.25%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2985      +/-   ##
===========================================
- Coverage    79.80%   79.74%   -0.07%     
===========================================
  Files           64       64              
  Lines         8674     8732      +58     
===========================================
+ Hits          6922     6963      +41     
- Misses        1752     1769      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cbentejac cbentejac changed the title Limit the statistics number of observations [core] Limit the statistics number of observations Jan 23, 2026
@cbentejac cbentejac requested a review from Copilot January 23, 2026 20:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the runtime statistics collection so memory usage stays bounded over long sessions by limiting stored samples and progressively downsampling while increasing the sampling interval.

Changes:

  • Added a maxPoints parameter and logic in Statistics.update to downsample existing data and double the sampling interval once the number of collected points exceeds the configured limit.
  • Introduced _filterDataPoints to uniformly subsample times, computer.curves, and process.curves in sync.
  • Extended Statistics serialization/deserialization to persist maxPoints, interval, and a new baseInterval attribute across sessions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread meshroom/core/stats.py Outdated
@cbentejac cbentejac merged commit 88ef217 into develop Jan 23, 2026
3 of 4 checks passed
@cbentejac cbentejac deleted the dev/statistics branch January 23, 2026 21:30
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.

3 participants