Generate optimized code on cling


One of my biggest issue while using ROOT is that cling can only JIT um-optimized code (equivalent to -O0). This have been the biggest annoyance while using ROOT that I have to run ACLiC for faster analysis. But I can’t enjoy the extensions thatcling provides like shadowing variables, REPL, etc… while using ACLiC. is there a way to get cling to JIT -O2 or even -O3 code? If not how far is cling to supporting it?


#pragma cling optimize(3) doesn’t work for you? You can switch all of cling into continuous -O3 mode using .O 3 on the prompt.

Oops, I mean in ROOT. .help shows

   .O <level>			- Sets the optimization level (0-3)
						  (not yet implemented)

I’m using 6.20/04.

edit: Thanks, I’ve tested #pragma cling optimize(3) and .O 3 does make the code faster on both cling and ROOT. But the JITed code is slower than what GCC/clang generates at -O1. Is this normal?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.