[Mono-dev] Profile with optimizations

Alex Rønne Petersen alex at alexrp.com
Tue Jan 12 11:21:31 UTC 2016


What *might* work is calling mono_jit_parse_options () from your
mono_profiler_startup () callback. Something like:

    mono_jit_parse_options (1, (char*[]) { "-O=-all" });

Replace `-all` with whatever you need. I think your callback should be
called late enough that this'll override user flags (if that's really
what you want to do).

Regards,
Alex

On Tue, Jan 12, 2016 at 12:09 PM, Greg Young <gregoryyoung1 at gmail.com> wrote:
> but can I disable this behaviour from inside of a profiler?
>
> On Tue, Jan 12, 2016 at 12:04 PM, Alex Rønne Petersen <alex at alexrp.com> wrote:
>> Well, here's a simple test: https://gist.github.com/alexrp/9d4ee5b488f9ee57c297
>>
>> If you run this with `MONO_VERBOSE_METHOD=Main mono --profile=log`,
>> you'll see: https://gist.github.com/alexrp/d90e73bfdd0469f5f6c0
>>
>> Looking at the DUMP BLOCK output, you can see that Add was inlined and
>> constant folded as expected.
>>
>> Regards,
>> Alex
>>
>> On Fri, Jan 8, 2016 at 10:02 PM, Greg Young <gregoryyoung1 at gmail.com> wrote:
>>> Hmm I have yet to see in any test runs the behaviour of optimizations
>>> like inlining enabled. I would assume a simple test case should
>>> produce it? If optimizations are enabled (and I can reproduce it) is
>>> there any way to disable them as a profiler?
>>>
>>> On Fri, Jan 8, 2016 at 8:47 PM, Alex Rønne Petersen <alex at alexrp.com> wrote:
>>>> Hey Greg,
>>>>
>>>> Do you have a test case that demonstrates what you're seeing? From
>>>> what I can see, the runtime should not be disabling optimizations just
>>>> because the profiler is attached. However, if you're running with
>>>> --debug or some such option, all optimizations will be off.
>>>>
>>>> Regards,
>>>> Alex
>>>>
>>>> On Fri, Jan 8, 2016 at 1:25 PM, Greg Young <gregoryyoung1 at gmail.com> wrote:
>>>>> It may be in the new profiling API changes that are there but I can't
>>>>> seem to find it in the older profiling api. Is there a way to enable
>>>>> JIT optimizations such as inlining and profile? It seems enabling
>>>>> profiler always disables optimizations.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Greg
>>>>>
>>>>> --
>>>>> Studying for the Turing test
>>>>> _______________________________________________
>>>>> Mono-devel-list mailing list
>>>>> Mono-devel-list at lists.ximian.com
>>>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>>
>>>
>>>
>>> --
>>> Studying for the Turing test
>
>
>
> --
> Studying for the Turing test


More information about the Mono-devel-list mailing list