<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Mar 26, 2018, at 6:16 AM, Roman Kennke <<a href="mailto:rkennke@redhat.com" class="">rkennke@redhat.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">However, in order to not cause regressions in any code I might have</span><br style="font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">overlooked, I did change the new stuff to inlining, and hunted down the</span><br style="font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">places where it breaks compilation.</span><br style="font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote></div><br class=""><div class="">Thank you; I think this is the right step even if there is evidence</div><div class="">that an out-of-line oopDesc::equals might be harmless, in today's</div><div class="">code base with today's benchmarks.</div><div class=""><br class=""></div><div class="">HotSpot is built (today) using the C++ performance model where</div><div class="">inlining is the safe way to boil down abstract operations to concrete</div><div class="">one. In the case of operator==, the concrete operation is a single</div><div class="">instruction (or sometimes no instructions at all, with a clever optimizer).</div><div class=""><br class=""></div><div class="">We know it's often harmless to replace such an optimizable operation</div><div class="">with a much heavier one (a function call that won't be inlined, in this</div><div class="">case). But, in the case of *very simple* concrete operations like op==,</div><div class="">there is always a risk of a future well-meant code change causing a</div><div class="">sudden and surprising performance regression, as well as a rarely</div><div class="">taken code path suddenly failing to scale in the field.</div><div class=""><br class=""></div><div class="">So our customary treatment of very simple concrete operations</div><div class="">is to abstract them however we like, but express their abstractions</div><div class="">in terms of inlines, wherever there might be risk of performance</div><div class="">surprises.</div><div class=""><br class=""></div><div class="">This is clearly one of those cases. Let's code against surprises</div><div class="">(both present and future) by abstracting simpler operations with</div><div class="">inlines.</div><div class=""><br class=""></div><div class="">— John</div></body></html>