Fix performance warnings
Chris Seaton
chris.seaton at oracle.com
Sat May 23 10:14:10 UTC 2015
To remove the non-inlined interface and virtual calls you want specifically an ExactClassValueProfile - not an IdentityValueProfile or PrimitiveValueProfile, so check you are using the right one.
In Ruby I put a value profile on all arguments as they are unpacked into locals in the method prelude. To me that seemed like a sensible place to put them but I haven’t looked into other options.
Non-leaf type checkcast means you are checking the class of an object against a class that has subclasses or more than one implementation. This isn’t as efficient as checking against a leaf class. This isn’t an error, and we get similar warnings when I run JRuby+Truffle with this flag, but may be a symptom of a class hierarchy that is too elaborate.
In general the fact that you are compiling methods that use things like List is unusual. It’s an interface with many implementations of course so that would likely lead to the problems you are having. For this reason we use data structures like int[] and Object[] in JRuby+Truffle, rather than the more complicated List. Where we do use List it’s usually behind a TruffleBoundary.
Are you able to share your code so we can see what you’re doing and advise further?
Chris
> On 21 May 2015, at 23:21, Renze Torensma <renzetorensma at gmail.com> wrote:
>
> Hi,
>
> When I run my program with the compiler flag -G:+TraceTrufflePerformanceWarnings I get several warnings:
>
> [truffle] perf warn not inlined Interface call to HotSpotMethod<List.size()> (36|MethodCallTarget)
> [truffle] perf warn not inlined Virtual call to HotSpotMethod<Type.getArity()> (97|MethodCallTarget)
> [truffle] perf warn non-leaf type checkcast: Lorg/rascalmpl/interpreter/result/AbstractFunction; (82|CheckCast)
>
> I understand Truffle can’t inline virtual and interface calls (are interface calls also virtual calls?) but I’m not sure how to fix those issues. I tried using a ValueProfile but I’m not sure which function calls I should wrap with a profile since I don’t know which lines exactly (it only says 36|MethodCallTarget but I don’t know what that means). And I don’t know whether or not this is the right approach to fix those performance issues.
>
> For the last one I have no clue what that means, maybe someone can expain a little and some pointers about how to fix that?
>
> Regards,
> Renze
More information about the graal-dev
mailing list