RFR (S): 8067014: LinearScan::is_sorted significantly slows down fastdebug builds' performance

Filipp Zhinkin filipp.zhinkin at gmail.com
Fri Feb 19 07:12:01 UTC 2016

Hi Aleksey,

On Thu, Feb 18, 2016 at 6:55 PM, Aleksey Shipilev
<aleksey.shipilev at oracle.com> wrote:
> Hi Filipp,
> On 02/18/2016 06:31 PM, Filipp Zhinkin wrote:
>> I've looked at how frequently misses are actually occur and
>> how far false positives are from the interval we're looking for.
>> Also I've tried to implement interval_cmp so that it returns 0
>> if difference between interval "from" values is below some threshold:
>> http://cr.openjdk.java.net/~fzhinkin/8067014/webrev.02/stats.txt
>> All those misses with distance greater than 64 came from
>> javax.swing.plaf.synth.SynthStyle::populateDefaultValues [1].
> Okay, let me recap: your data seems to say that current binary search
> misses in 25% of the cases, and around 95% of the misses are within 8
> intervals from the false value, right? And almost all 99.99% are within
> 32 intervals?


> This does not seem bad, I was afraid of orders of magnitude larger values.
>> I've also looked to another possible slowness sources and
>> we spend about 10% of time in LinearScan's verify_intervals method
>> which checks that every two intervals don't simultaneously intersect
>> and share the same register [2].
>> I don't see a way to significantly speed up such verification,
>> but I've slightly improved performance by rearranging some expressions.
> Yes, those re-arrangements make sense.
>> Here is an updated webrev:
>> http://cr.openjdk.java.net/~fzhinkin/8067014/webrev.02/
> Looks good to me (not a Reviewer).


>> Also, unless CommentedAssembly flag is explicitly turned off,
>> we're generating comments for stubs even if we're not going to print it out.
>> Avoiding comments generation in such case will speed up compilation a bit more,
>> but I think it would be better to deal with it in a separate RFE.
>> Difference in code emission time is about 30% when CommentedAssembly is off
>> (~ 40s w/ CommentedAssembly, ~ 25s w/o CommentedAssembly).
> Oh wow. Let's fix that! Of course, separate RFE is fine.

Here is it: https://bugs.openjdk.java.net/browse/JDK-8150222


> Cheers,
> -Aleksey

More information about the hotspot-compiler-dev mailing list