Rhino.Context.SetOptimizationLevel C# (CSharp) Method

SetOptimizationLevel() public method

Set the current optimization level.
Set the current optimization level.

The optimization level is expected to be an integer between -1 and 9. Any negative values will be interpreted as -1, and any values greater than 9 will be interpreted as 9. An optimization level of -1 indicates that interpretive mode will always be used. Levels 0 through 9 indicate that class files may be generated. Higher optimization levels trade off compile time performance for runtime performance. The optimizer level can't be set greater than -1 if the optimizer package doesn't exist at run time.

public SetOptimizationLevel ( int optimizationLevel ) : void
optimizationLevel int /// an integer indicating the level of /// optimization to perform ///
return void
		public void SetOptimizationLevel(int optimizationLevel)
		{
			if (@sealed)
			{
				OnSealedMutation();
			}
			if (optimizationLevel == -2)
			{
				// To be compatible with Cocoon fork
				optimizationLevel = -1;
			}
			CheckOptimizationLevel(optimizationLevel);
			if (codegenClass == null)
			{
				optimizationLevel = -1;
			}
			this.optimizationLevel = optimizationLevel;
		}

Usage Example

Example #1
0
		protected internal override void OnContextCreated(Context cx)
		{
			cx.SetLanguageVersion(languageVersion);
			cx.SetOptimizationLevel(optimizationLevel);
			if (errorReporter != null)
			{
				cx.SetErrorReporter(errorReporter);
			}
			cx.SetGeneratingDebug(generatingDebug);
			base.OnContextCreated(cx);
		}
All Usage Examples Of Rhino.Context::SetOptimizationLevel
Context