Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

Vishal772-pixel
Copy link

This PR refactors the aggregation of cm_g in Mlin::mlin() from a fold-based approach to a simple in-place for loop.

@v0-e
Copy link
Member

v0-e commented Sep 30, 2025

Thank you for the PR @Vishal772-pixel 👍

Could you explain why is this an optimization?

@Vishal772-pixel
Copy link
Author

The original fold approach is correct but may create unnecessary moves and allocations per iteration.
Replacing it with a pre-allocated Vec and in-place accumulation improves efficiency slightly, is cache-friendly

as i thought ...maybe theirs more perspective to this ?
@v0-e ..let me know if i am wrong

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.