Skip to content

Add a StatisticsManager for averaging the results of repeated profilings.#7

Open
zyrxvo wants to merge 20 commits intomainfrom
stats-manager
Open

Add a StatisticsManager for averaging the results of repeated profilings.#7
zyrxvo wants to merge 20 commits intomainfrom
stats-manager

Conversation

@zyrxvo
Copy link
Collaborator

@zyrxvo zyrxvo commented Feb 12, 2026

Sometimes profiling results differ slightly between runs from noise or other factors. These changes support more consistent and stable benchmarking endeavours by adding conveniences for profiling scripts repeatedly and averaging over the results.

We add a new StatisticsManager class to accomplish this internally and provide CLI access via the stats command.

We also refactor the config to be more flexible and robust.

Copy link

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 pull request adds a StatisticsManager class to support repeated profiling and averaging of results for more stable benchmarking. The PR also adds CLI support via a new stats command and the --repeat flag on the profile command.

Changes:

  • Added StatisticsManager class for computing averages and standard deviations of profiling results
  • Added stats CLI command for post-processing multiple profile JSON files
  • Added --repeat, --in-place, --quiet, and --output-directory flags to the profile command
  • Updated the colours dependency (v0.1.1 → v0.2.0) and added gitpython (v3.1.46)
  • Added git metadata tracking for benchmarking (repo, branch, commit, dirty files, UTC timestamp)
  • Updated various Colour.print() calls to use more specific logging methods (error, warning, info)
  • Added walltime, user_time, system_time, total_time fields to ProfileDetails
  • Modified profiler initialization to support in_place and custom output_dir parameters
  • Changed log file name from logs.log to profile_logs.log

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
uv.lock Updated colours dependency and added gitpython with dependencies
pyproject.toml Updated version to 0.3.0, added gitpython dependency, updated colours revision
fixingahole/profiler/stats_manager.py New file implementing statistics aggregation and metadata tracking
fixingahole/profiler/profiler.py Added support for repeated runs, in-place profiling, custom output directories
fixingahole/profiler/profile_summary.py Added walltime to ProfileDetails, added time calculation properties
fixingahole/profiler/utils.py Added subfolder_only parameter to find_path, updated error handling
fixingahole/cli/main.py Added stats command, added new CLI flags for profile command
fixingahole/init.py Exported StatisticsManager class
fixingahole/config.py Updated error handling to use new Colour methods
tests/* Comprehensive test coverage for new features, updated existing tests
README.md Documented new features and benchmarking workflow
.pre-commit-config.yaml Added end-of-file-fixer and trailing-whitespace hooks

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

Copy link

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

Copilot reviewed 20 out of 21 changed files in this pull request and generated 6 comments.


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

Copy link

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

Copilot reviewed 23 out of 24 changed files in this pull request and generated 7 comments.


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

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.

1 participant

Comments