Just In Time vs Ahead Of Time Compilation
Posted By : Satwinder Singh | 13-Jun-2018
Just in Time Compilation
Just in Time is the default compilation followed by Angular. Here, we develop our code then we ship it which is preformed when we run “ng-serve”, there it constantly gets compiled and served on our development server which is same as to ship it to production and then we view it in the browser and the app gets downloaded and once it is downloaded Angular bootstraps the application and in this step, it also parses and compiles the templates because that’s the first time it has time to do so, before that our app never ran. That is the default approach that Angular follows while compiling our code. But the good thing is that Angular allows us to change this procedure by using AOT compilation.
Ahead of Time Compilation
Advantages of AOT compilation
Faster startup as Parsing and Compilation doesn’t happen in the Browser.
Smaller File Size as unused Features can be stripped out and the Compiler itself isn’t shipped.