Skip to content

Use intrinsified Math.multiplyHigh()#1577

Merged
cowtowncoder merged 2 commits intoFasterXML:3.xfrom
xtonik:1576-multiplyHigh
Mar 17, 2026
Merged

Use intrinsified Math.multiplyHigh()#1577
cowtowncoder merged 2 commits intoFasterXML:3.xfrom
xtonik:1576-multiplyHigh

Conversation

@xtonik
Copy link
Contributor

@xtonik xtonik commented Mar 17, 2026

Prefer use of intrinsified method Math.multiplyHigh() over custom implementation as reported in #1576. Even built-in JDK method is for signed values and thus signed result, it works well for positive value also. Possible fallback to not intrinsified JDK version does not affect negatively performance as demonstrated in this benchmark (not provided) results:

  (multiplier) Mode Cnt Score Error Units
MultiplyHighBenchmark.multiplyHigh SIGNED_INTRINSIFIED thrpt 10 0.991 ± 0.443 ops/us
MultiplyHighBenchmark.multiplyHigh SIGNED thrpt 10 0.386 ± 0.014 ops/us
MultiplyHighBenchmark.multiplyHigh UNSIGNED_JACKSON thrpt 10 0.388 ± 0.012 ops/us
MultiplyHighBenchmark.multiplyHigh UNSIGNED_INTRINSIFIED thrpt 10 0.999 ± 0.048 ops/us

@cowtowncoder cowtowncoder added the cla-received PR already covered by CLA (optional label) label Mar 17, 2026
Copy link
Member

@cowtowncoder cowtowncoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

📈 Overall Code Coverage

Metric Coverage Change
Instructions coverage 83.08% 📉 -0.010%
Branches branches 75.74% 📈 +0.010%

Overall project coverage from JaCoCo test results. Change values compare against the latest base branch build.

@cowtowncoder cowtowncoder merged commit 032014d into FasterXML:3.x Mar 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-received PR already covered by CLA (optional label)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants