Yuri
2010-Apr-29 17:21 UTC
[LLVMdev] Why the same code is much slower in JIT compared to separate executable?
Török Edwin wrote:> Are you using 2.6 or 2.7, 32-bit or 64-bit? >I use 2.7 on i386. lli has debug asserts enabled, but I guess this shouldn't matter for JIT code speed. jit: 11.32 real exe: 7.64 user Both have -O3 option. Speed should be the same. Yuri
Török Edwin
2010-Apr-29 17:55 UTC
[LLVMdev] Why the same code is much slower in JIT compared to separate executable?
On 04/29/2010 08:21 PM, Yuri wrote:> Török Edwin wrote: >> Are you using 2.6 or 2.7, 32-bit or 64-bit? >> > > I use 2.7 on i386. lli has debugtry a release build (ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1)> asserts enabled, but I guess this > shouldn't matter for JIT code speed. > > jit: 11.32 real > exe: 7.64 user > > Both have -O3 option. Speed should be the same. > > Yuri
Óscar Fuentes
2010-Apr-29 19:32 UTC
[LLVMdev] Why the same code is much slower in JIT compared to separate executable?
Yuri <yuri at tsoft.com> writes:> Török Edwin wrote: >> Are you using 2.6 or 2.7, 32-bit or 64-bit? >> > > I use 2.7 on i386. lli has debug asserts enabled, but I guess this > shouldn't matter for JIT code speed. > > jit: 11.32 real > exe: 7.64 user > > Both have -O3 option. Speed should be the same.With time lli -O3 fib.bc 45 you are measuring the time lli takes optimizing the LLVM code, generating the native code and, finally, executing it. If you add to this the debug asserts, it is not surprising that lli ends being quite a bit slower than directly executing the native code. As Török suggests, using a Release build with asserts off will make a difference on lli's speed.
Óscar Fuentes
2010-Apr-29 20:08 UTC
[LLVMdev] Why the same code is much slower in JIT compared to separate executable?
Yuri <yuri at tsoft.com> writes:>> With >> >> time lli -O3 fib.bc 45 >> >> you are measuring the time lli takes optimizing the LLVM code, >> generating the native code and, finally, executing it. If you add to >> this the debug asserts, it is not surprising that lli ends being quite a >> bit slower than directly executing the native code > > You can see that this is not true running 'time lli -O3 fib.bc 4', > which has exactly the same code. Compiler still compiles the same way, > and it takes 0.00 user seconds.You are right. The code is small enough to have any impact on the total required time. Try passing -print-machineinstrs to lli and compare the output with the assembler generated by llc.
Apparently Analagous Threads
- [LLVMdev] Why the same code is much slower in JIT compared to separate executable?
- [LLVMdev] Why the same code is much slower in JIT compared to separate executable?
- [LLVMdev] Why the same code is much slower in JIT compared to separate executable?
- [LLVMdev] Why the same code is much slower in JIT compared to separate executable?
- [LLVMdev] Why the same code is much slower in JIT compared to separate executable?