1.

Explain Explicit Compilation (Ahead Of Time compilation).

Answer»
  • Ahead-of-time(AOT) compilation is the process of compiling a high-level language into a low-level language during build-time, i.e., before program execution. AOT compilation reduces the workload during run time.
  • AOT provides faster start-up time, in larger applications where most of the code executes on startup. But it needs more amount of disk space and memory or virtual address space to hold both IL(Intermediate Language) and precompiled images. In this case, the JIT(Just In Time) Compiler will do a lot of work like disk I/O actions, which are expensive.
  • The explicit compilation will convert the upper-level language into object code on the execution of the program. Ahead of time(AOT) compilers are designed for ensuring whether the CPU will UNDERSTAND line-by-line code before doing any interaction with it.
  • Ahead-of-Time (AOT) compilation happens only once during build time and it does not require shipping the HTML templates and the Angular compiler into the bundle. The source code generated can begin running immediately after it has been downloaded into the browser, EARLIER steps are not required. The AOT compilation will turn the HTML template into the runnable code FRAGMENT. AOT will analyze and compile our templates statically during build time.

Benefits of AOT Compilation:

  • Application size is smaller because the Compiler itself isn’t shipped and unused features can be removed.
  • Template the parse errors that are detected previously(during build time)
  • Security is high (not required to dynamically evaluate templates)
  • Rendering of a component is faster (pre-compiled templates)
  • For AOT compilation, some tools are required to accomplish it automatically in the build process.


Discussion

No Comment Found