[LLVMdev] Slow jitter.

Evan Cheng evan.cheng at apple.com
Wed Aug 26 16:25:56 PDT 2009


On Aug 26, 2009, at 8:07 AM, Óscar Fuentes wrote:

> Albert Graef <Dr.Graef at t-online.de> writes:
>
>> Óscar Fuentes wrote:
>>> With this change the time used by code generation goes down from 33
>>> seconds to 26.5.
>>
>> ... and that's probably not worth it because of the loss of code
>> quality.
>
> Agreed. The JIT with default options produces slightly slower code  
> than
> a brain-dead alternative backend my compiler has. I expect that once
> optimization passes are added to the JIT its code will turn  
> "industrial
> grade". That's the justification for adding LLVM support, but if
> application startup needs several minutes...

llvm JIT does not do optimizations. If that's important for your  
application you need to add the optimization passes before passing the  
bitcode to the JIT. Of course those optimization passes take time but  
it may significantly speed up codegen.

Evan

>
>> In Pure I always  use llvm::CodeGenOpt::Aggressive, although
>> there's a preprocessor symbol to select llvm::CodeGenOpt::None at
>> compile time.
>>
>> I also found that in Pure the lion's share of compilation time is  
>> spent
>> in the JIT (and I have a bunch of optimization passes enabled, which
>> don't add much to the total compilation time). That's why I always  
>> let
>> the JIT do its lazy compilation thing, in an interactive
>> interpreter-like environment that's quite sensible. If people want to
>> get rid of the JIT latency, they have the option to compile their  
>> Pure
>> scripts to native executables. This approach works very well for me.
>
> Sadly, I cannot produce executables (at least for a large part of the
> application's code) and freezing the application for several seconds
> here and there while the JIT does its stuff is not an option either,  
> so
> I'm forced to JIT all the code on startup.
>
> -- 
> Óscar
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list