[ 
https://issues.apache.org/jira/browse/LUCENE-9679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17268316#comment-17268316
 ] 

Robert Muir commented on LUCENE-9679:
-------------------------------------

I don't think its a good idea: to my knowledge, using Math.fma won't make 
things faster, just save a rounding. That's if the instruction is supported, 
which it isn't on all cpus.

If its not supported, its gonna get slooooooow.

I think it would be better to make sure the current logic vectorizes.

> Try using Math.fma to speed up vector computations
> --------------------------------------------------
>
>                 Key: LUCENE-9679
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9679
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael Sokolov
>            Priority: Major
>
> On the mailing list, Anton Hägerstrand <[email protected]> posted a link to a 
> blog post showing hotspots in our indexing: 
> https://blunders.io/posts/lucene-bench-2021-01-10 and identified vecto dot 
> product computations as one of them. Not surprising in itself, but he also 
> suggested we might want to try using {{Math.fma}} in the computation to see 
> if it can optimize the multiply-and-add operation that is at the heart of 
> both the dot product and l2-norm distance.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to