# Disable compilation of scripts

**URL:** <https://www.ruby-forum.com/t/disable-compilation-of-scripts/178765>\
**Category:** IronRuby\
**Created:** [November 11, 2009, 1:46am UTC](https://www.ruby-forum.com/t/disable-compilation-of-scripts/178765 "2009-11-11T01:46:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 1:46am UTC](https://www.ruby-forum.com/t/disable-compilation-of-scripts/178765/1 "2009-11-11T01:46:17Z")

</div>

Hello,

A while back I watched Jimmy on C9 talking about how IronRuby had a  
hybrid approach to execution only jitting after a code path had been  
run a couple times. Is there any way to control this. I’d like to  
experiment with either (1) turning off compilation and (2) forcing  
immediate compilation. The scenario is that there are times when i  
might be able to get away with the “compilation penalty” and I’d like  
to play around with doing just that.

Is there anywhere I can find information on how to do this with the DLR?

Thanks,  
Martin

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 2:14am UTC](https://www.ruby-forum.com/t/disable-compilation-of-scripts/178765/2 "2009-11-11T02:14:23Z")

</div>

There is. You can set “NoAdaptiveCompilation” options on language setup  
when creating ScriptRuntime. Command line option is  
-X:NoAdaptiveCompilation.  
We’ll also add “CompilationThreshold” option soon, which specifies the  
number of iterations before we start compiling.

Tomas

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 3:45am UTC](https://www.ruby-forum.com/t/disable-compilation-of-scripts/178765/3 "2009-11-11T03:45:44Z")

</div>

Thanks Tomas!

I also found the InterpretedMode flag as well.

I’ve been looking a little more and it looks like the bulk of our  
problems are related to running IronRuby code through the [VS.NET](http://VS.NET)  
debugger. We had a script that was taking 15 seconds or more to run  
but runs in under a half second when we run our app outside of Visual  
Studio. Compiling does confer some pretty serious advantages though.

Thanks!  
Martin

On Tue, Nov 10, 2009 at 5:14 PM, Tomas M.

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 8:45pm UTC](https://www.ruby-forum.com/t/disable-compilation-of-scripts/178765/4 "2009-11-11T20:45:23Z")

</div>

Hey Tomas,

Are you planning on allowing the CompilationThreshold option to be  
set… so basically I’d envision:

1. app startup CompilationThreshold = 0
2. warm up and jit all the ruby code
3. after startup is finished set CompilationThreshold = 50 (or  
something) so we can issue quick calls to the already compiled code.

That would be pretty cool if it could work that way.

Thanks,  
Martin

On Tue, Nov 10, 2009 at 5:14 PM, Tomas M.
