harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Fursov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5584) [drlvm][jit][opt][performance] Inliner heuristics improvements: hotness and instance initializer bonuses
Date Wed, 19 Mar 2008 09:50:24 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-5584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580289#action_12580289

Mikhail Fursov commented on HARMONY-5584:

>Can we just increase the timeout then?

It's possible to create an option for the test system: customizable timeout for every test.
But this is not the easiest way.

Did you check -XX:jit.arg.time=on output? It's possible that some optimizations do too much
checking in debug mode and this is the reason. We can easily move such checking under some
special option and solve the problem.

I just want to mention that the condition of the patch to be integrated: there are tests failed.

BTW  #define MAX_INLINE_GROWTH_FACTOR_PROF 1000 passes regression testing in debug mode in
my environment. Is this value enough?

> [drlvm][jit][opt][performance] Inliner heuristics improvements: hotness and instance
initializer bonuses
> --------------------------------------------------------------------------------------------------------
>                 Key: HARMONY-5584
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5584
>             Project: Harmony
>          Issue Type: Improvement
>         Environment: all
>            Reporter: Aleksey Shipilev
>            Assignee: Mikhail Fursov
>         Attachments: H5584-inliner-heuristics.patch
> During the profiling of Scimark2 [1] it was found that inliner misses the inline opportunities
for monte_carlo. 
> This is the code for hottest method:
> 	public static final double integrate(int Num_samples)
> 	{
> 		Random R = new Random(SEED);
> 		int under_curve = 0;
> 		for (int count=0; count<Num_samples; count++)
> 		{
> 			double x= R.nextDouble();
> 			double y= R.nextDouble();
> 			if ( x*x + y*y <= 1.0)
> 				 under_curve ++;
> 		}
> 		return ((double) under_curve / Num_samples) * 4.0;
> 	}
> Problems are:
>  1. nextDouble is not inlined
>  2. nextDouble is internally synchronized 
> Attached patch solves these two problems:
>  1. fixing hotness bonus calculation. This is the issue Random.nextDouble() hit on: this
method called in hot cycle and missing inline opportunity due to glitch in scaling function,
which should be more additive rather than multiplicative.
>  2. introducing instance initializer bonus. This helps to inline constructor with all
corresponding methods to help scalar replacement with scalarizing of R (and eliminating synchronization

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message