Call Targets Not Optimized

Cristian Esquivias cristian.esquivias at gmail.com
Sat Sep 17 08:18:47 UTC 2016


Nah, I meant just for manual testing. Off the bat, contorting my code for
the benchmark felt like that would give me skewed results, but then I
realized I can just stick my main function in an infinite loop and it
shouldn't be so bad. I'll fiddle with the flags just in case that suits my
needs. If I ever need something more robust I'll be sure to ask.

Thanks,
Cristian

On Sat, Sep 17, 2016 at 1:08 AM, Chris Seaton <chris.seaton at oracle.com>
wrote:

> You can use -Dgraal.TruffleCompileOnly=function_name, but for manual
> testing and just experimenting I almost always write an infinite loop. If
> you use too many options you can start to get an unrealistic understanding
> of how Truffle normally works.
>
> Or are you asking about automated testing, where an infinite loop isn’t
> going to work? For that case in Ruby I use CompilerAsserts.neverPartOfCompilation
> in a special Ruby method to stop the loop when it is compiled. This is
> complicated to get right though so ask if that’s what you’re doing and I’ll
> give more details.
>
> Chris
>
> On 17 Sep 2016, at 08:54, Cristian Esquivias <cristian.esquivias at gmail.com>
> wrote:
>
> Thanks Chris, having it run longer did the trick. I disabled background
> compilation and the program took forever (it's still running). Is there a
> way to trigger compilation for my functions for small tests without having
> to write infinite loops or blocking to compile every function?
>
> - Cristian
>
> On Sat, Sep 17, 2016 at 12:35 AM, Chris Seaton <chris.seaton at oracle.com>
> wrote:
>
>> Hi Christian,
>>
>> You run a loop 1000+ times, but then do you give it a chance to compile
>> before the program exits? You’ve got background compilation enabled so the
>> program won’t wait for compilation before it exits.
>>
>> Instead of running a loop 1000+ times, try making the loop infinite and
>> running it for a few seconds to see what happens longer term.
>>
>> Try -Dgraal.TraceTruffleCompilation and -Dgraal.TraceTruffleCompilationDetails
>> to see the compilation events printed as the program runs.
>>
>> Chris
>>
>> > On 17 Sep 2016, at 08:31, Cristian Esquivias <
>> cristian.esquivias at gmail.com> wrote:
>> >
>> > I moved to a new system and downloaded the latest Graal VM from OTN to
>> try
>> > it out. When I ran IGV to see compilations none of my functions
>> appeared. I
>> > enabled the TruffleCallTargetProfiling and TruffleCompilationStatistics
>> > flags and saw that none of my functions were optimized.
>> >
>> > Am I doing something wrong? I haven't changed my code, and I'm fairly
>> > certain compilation was triggered on my old system (I don't have access
>> to
>> > it anymore).
>> >
>> > I think I set up Graal properly. I basically just call java from my
>> > downloaded VM like I normally do. Here's the full command for reference.
>> >
>> > ~/lib/graalvm-0.16/bin/java
>> > -Dgraal.TruffleCompilationStatistics=true
>> > -Dgraal.TruffleCompilationExceptionsAreFatal=true
>> > -Dgraal.TruffleCallTargetProfiling=true -Dgraal.Dump
>> > -Dgraal.TruffleBackgroundCompilation=true -Djvmci.option.Dump -cp
>> > $MUMBLER_LIB/antlr4-runtime-4.5.jar:$MUMBLER_LIB/lang.jar
>> > mumbler.truffle.TruffleMumblerMain /tmp/inline-test.mumbler
>> >
>> > My test program is a simple recursive loop that adds a number 1000+
>> times
>> > to trigger compilation. Nothing fancy.
>> >
>> > I tried to build graal per the instructions on GitHub but I get a
>> > compilation error.
>> >
>> > Some of the output from the flags:
>> >
>> > Truffle compilation statistics:
>> >  Compilations                                      : 0
>> >    Success                                         : 0
>> >    Failed                                          : 0
>> >    Interrupted                                     : 0
>> >  Invalidated                                       : 0
>> >  Queues                                            : 7
>> >  Dequeues                                          : 2
>> >  Splits                                            : 0
>> >  Compilation Accuracy                              : NaN
>> >  Queue Accuracy                                    : 0.714286
>> >  Compilation Utilization                           : 0.000000
>> >  Remaining Compilation Queue                       : 6
>> >
>> > Call Target                                         | Total Calls     ||
>> > Interp. Calls   | Opt. Calls      || Direct Calls    | Inlined Calls   |
>> > Indirect Calls  || Invalidations
>> >  [AddBuiltinNodeGen at 6e2c634b]                       |           26000
>> ||
>> >        26000 |               0 ||           26000 |               0 |
>> >          0 ||   0
>> >  [EqualBuiltinNodeGen at 4b9af9a9]                     |           23005
>> ||
>> >        23005 |               0 ||           23005 |               0 |
>> >          0 ||   0
>> >  [SubBuiltinNodeGen at 4d405ef7]                       |           23001
>> ||
>> >        23001 |               0 ||           23001 |               0 |
>> >          0 ||   0
>> >
>> > Thanks,
>> > Cristian
>>
>>
>
>


More information about the graal-dev mailing list