Skip to content

Conversation

@jqnatividad
Copy link
Collaborator

Also optimized for computing streaming bivariate stats by default

Copy link
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 introduces a significant performance optimization to the moarstats command's bivariate statistics computation by:

  1. Adding a new --bivariate-stats flag that allows users to selectively compute only the statistics they need
  2. Changing the default behavior to compute only "fast" statistics (Pearson correlation and covariance) which use streaming algorithms
  3. Optimizing the Kendall tau computation to avoid unnecessary vector clones

The key changes include:

  • New BivariateStatsConfig struct to configure which statistics to compute
  • Conditional allocation and computation based on the selected statistics
  • Dynamic CSV header and row generation based on requested statistics
  • Comprehensive test coverage for the new flag options

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/cmd/moarstats.rs Added --bivariate-stats flag, BivariateStatsConfig struct, conditional computation logic, optimized Kendall tau, and dynamic output generation
tests/test_moarstats.rs Updated existing tests to explicitly request "all" statistics where needed, and added three new tests for the flag options (pearson-only, multiple stats, and all stats)

jqnatividad and others added 2 commits December 29, 2025 08:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jqnatividad jqnatividad requested a review from Copilot December 29, 2025 15:07
…is triggering false positive devskim security alert

being confused with a weak hashing algorithm
Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

found by GH Copilot review, but was not flagged as it was outside the changed code.
Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

@jqnatividad jqnatividad merged commit 1bf7cad into master Dec 29, 2025
22 of 23 checks passed
@jqnatividad jqnatividad deleted the moarstats-faster-bivariate branch December 29, 2025 16:03
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.

2 participants