The Wolfram Technology Guide


Technology Guide

More About Mathematica
Transparent Auto-Compilation (TAC)  
PreviousNext
 
   
 
Although compilation takes time, it can speed up a repetitive computation overall. Mathematica's TAC determines when compilation will be beneficial and applies it in just these cases.

When carrying out large repetitive numerical computations, either requested by the user directly--for example creating a table--or implicitly--solving a differential equation numerically--Mathematica automatically generates optimized byte code to speed up the computations, a process known as just-in-time compilation.

The instructions created are chosen to be close to those found in the machine code of a typical computer, and can thus be executed quickly. For large expressions, compilation can speed up execution by a factor of 20 or more. Many Mathematica functions, for example NIntegrate, use compilation by default, while others, for example the Table command, invoke compilation dynamically, based on the type and complexity of the expression evaluated and the number of evaluations requested.

Related Links
Technology Guide: gigaNumerics
Function documentation: Compile, Compiled, NIntegrate
The Mathematica Book: Section 2.6.15





© 2006 Wolfram Research, Inc.