Skip to content

[repo-assist] perf: add [AggressiveInlining] to operator * - #223

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/perf-multiply-inline-2026-07-12-d0c46fd9cc0e034f
Draft

[repo-assist] perf: add [AggressiveInlining] to operator *#223
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/perf-multiply-inline-2026-07-12-d0c46fd9cc0e034f

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds [MethodImpl(MethodImplOptions.AggressiveInlining)] to operator *.

Rationale

operator * is invoked on every multiply and is used inside Lerp, Pow, and consumer calculation loops. Every other arithmetic operator (+, -, unary -, /, %, ++, --) already carries [AggressiveInlining]; * was the only one missing the annotation.

By hinting the JIT to inline the Int128-multiply + banker's-round sequence at call sites, we eliminate the call overhead for tight loops that repeatedly multiply FixedPointNano values. The existing MultiplyRaw benchmark exercises this path.

Changes

  • src/FixedPointNano/FixedPointNano.cs — one line added to operator *

Test Status

dotnet build — succeeded, 0 warnings
dotnet test — 1426/1426 passed

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Add this agentic workflows to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@e15e57b40918dbca11b350c55d02ab61934afa75

operator * is called in hot-path code (Lerp, Pow, consumer loops).
Marking it [AggressiveInlining] allows the JIT to inline the
Int128-multiply + bankers-round sequence at call sites, reducing
call overhead for tight calculation loops.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

0 participants