Skip to content

Conversation

@JeWaVe
Copy link

@JeWaVe JeWaVe commented Jan 15, 2026

Before :
an array of 1000 double is allocated and computed for each erfinv call

Now :
Lazy allocation for coefficient in a readonly struct with static constructor
Allocation and computation is done only once, first time we invoke erfinv

We are excited to review your PR.

So we can do the best job, please check:

  • [x ] There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR. (didn't see any tests)

Lazy allocation for coefficient in a readonly struct with static constructor
Allocation and computation is done only once, first time we invoke erfinv
On the other side, 8kb won't be collected
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.02%. Comparing base (adf0cec) to head (bfefa76).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/Microsoft.ML.CpuMath/ProbabilityFunctions.cs 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7569      +/-   ##
==========================================
- Coverage   69.02%   69.02%   -0.01%     
==========================================
  Files        1482     1482              
  Lines      274096   274099       +3     
  Branches    28266    28266              
==========================================
- Hits       189191   189187       -4     
- Misses      77518    77526       +8     
+ Partials     7387     7386       -1     
Flag Coverage Δ
Debug 69.02% <0.00%> (-0.01%) ⬇️
production 63.30% <0.00%> (-0.01%) ⬇️
test 89.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Microsoft.ML.CpuMath/ProbabilityFunctions.cs 50.00% <0.00%> (-1.86%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant