On Thu, Jul 27, 2023 at 9:19 AM Uwe Schindler <u...@thetaphi.de> wrote:

See Shipilevs blog:
> https://shipilev.net/jvm/anatomy-quarks/30-conditional-moves/
>

Really interesting!  This is an awesome, quick explanation of the tradeoff
CMOV is making (pre-computing both paths) vs branching (have to predict,
with high cost of mis-prediction).  Maybe priority queues (used heavily in
Lucene, e.g. during disjunctive search, merging of terms during indexing or
by MultiTerms at search time, etc.) are a possible place where the branch
is hard to predict (on up or down heaping) and maybe CMOV could help?

He also has some examples and also there's a command line option to tell
> hotspot when to use cmov: -XX:ConditionalMoveLimit
>

Yay!  Another fun JVM command-line flag to tweak :)

Mike McCandless

http://blog.mikemccandless.com

Reply via email to