Turn off All Optimizations
Xin Tong
xerox.time.tech at gmail.com
Thu Nov 22 22:43:53 PST 2012
On Thu, Nov 22, 2012 at 2:11 PM, Krystal Mo <krystal.mo at oracle.com> wrote:
> Hi Xin,
>
> So what you're looking for is some kind of baseline compiler, right?
> How does your study relate to the ones on different threading techniques for
> implementing interpreters? e.g. context-threading / inline-threading?
I want to exam why interpreter is slower than the JIT. it is commonly
believed (easily verifiable) that interpreter is typically much slower
than the JIT. but no one ( at least i am not aware of) has ever fully
investigated why. i want to look at the performance differences from a
microarchitectural point of view., including the following
1. branch prediction
2. instruction cache
3. data cache
4. dynamic instruction count.
5. TLB.
there may be more...
different implementations of interpreters dohave impact on the
results, but the context-threaded interpreter is believed to be more
friendly than the simple switch based interpreter.
>
> Unfortunately neither C1 nor C2 has a magic switch to turn off all
> optimizations. Turning code into SSA-form and back is already "optimizing"
> in a lot of cases; both C1 and C2 use SSA-form intermediate representations,
> so it wouldn't be reasonable to have such a magic switch.
>
I am modifying the opto compiler, trying to disable all the
optimizations. however, I think the Node *nn =
transform_old(n); in the PhaseIterGVN::optimize must be called for the
compiler to work. does this transform the node to SSA representation
which is later recognized by the code generator ?
Are their any optimizations in the code generator as well, e.g. does
hotspot run instruction scheduling ?
Xin
> If you're using the client VM, then you'd be using C1;
> If you're using the server VM, and if tiered compilation is not turned on
> (e.g. it's not turned on by default on JDK6 and JDK7 to date), then you'd be
> using C2;
> With tiered compilation, you'd be using both C1 and C2. A method could be
> compiled multiple times by either compilers.
>
> - Kris
>
>
> On 2012/11/23 1:18, Xin Tong wrote:
>>
>> I want the compiler to compile the code at the same time. i.e. i want
>> to study why the compiler is so much faster than the intepreter from a
>> microarchitectural point of view. enabling optimizations complicates
>> the problem.
>>
>> there are 2 compilers in the hotspot, the c1 and opto. which one is used ?
>>
>> Xin
>>
>> On Thu, Nov 22, 2012 at 12:06 PM, Aleksey Shipilev
>> <aleksey.shipilev at oracle.com> wrote:
>>>
>>> On 11/22/2012 09:00 PM, Xin Tong wrote:
>>>>
>>>> Is there a way to turn off all the optimizations the hotpot compiler
>>>> will do to the bytecode when JITting it.
>>>
>>> Use plain old interpreter with "-Xint"?
>>>
>>> -Aleksey.
>>>
>
More information about the hotspot-compiler-dev
mailing list