harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheng, BuQi (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5584) [drlvm][jit][opt][performance] Inliner heuristics improvements: hotness and instance initializer bonuses
Date Tue, 14 Oct 2008 08:51:46 GMT

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

Cheng, BuQi commented on HARMONY-5584:
--------------------------------------

Hi Aleksey:
 
 This is the data which will not count on InstanceInitilization bonus. However, we fixed the
escape analysis and extend the analysis method level: max_level=2. With this fix, the sync
elimiation is done also. However, the scalar replacement still don't work. The data is like
following:
 
cleanmax_level=2InstanceInitilize inlinemax_level=2InstanceInitilize inline
crypto.aes39.5937.7938.22-0.045466027-0.0346
crypto.rsa193.24178.11172.08-0.078296419-0.1095
crypto.signverify118.6111.5109.71-0.059865093-0.07496
compiler.compiler93.8695.291.250.014276582-0.02781
compiler.sunflow139.63133.45123.64-0.04425983-0.11452
scimark.fft.large14.815.0114.930.0141891890.008784
scimark.sor.large21.6921.6721.71-0.0009220840.000922
scimark.sparse.large12.8612.7712.88-0.0069984450.001555
scimark.monte_carlo298.17707.2977.291.3718013212.277627
xml.validation81.1779.182.15-0.0255020330.012073
scimark.fft.small931.98919.09931.98-0.0138307690
scimark.lu.small842.59811.66831.09-0.036708245-0.01365
scimark.sparse.small70.9570.9465.5-0.000140944-0.07681
serial  8.3288-0.038461538-0.03846

 
>From the data we can find the benefit distribution is: inline: 100,  sync elimiation:
300, scalar replacement:300. 
 
So, I think we add patch for inliner and escape analysis. For scalar replacement, it can be
solved by escape analysis associated work. 
 
Thanks!
 
Buqi

> [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
>          Components: DRLVM
>         Environment: all
>            Reporter: Aleksey Shipilev
>            Assignee: Mikhail Fursov
>         Attachments: H5584-inliner-heuristics.patch, 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
too).

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


Mime
View raw message