Just-in-Time (JiT) vs Ahead-of-Time (AoT) compilation in Angular

前端 未结 8 705
难免孤独
难免孤独 2020-12-04 05:50

I was referring this documentation and came across the compilation concept. One can use either JIT or AOT compilation. However, I found it very brief and need to know follow

相关标签:
8条回答
  • 2020-12-04 06:37

    JiT (Just in Time) Compilation

    The name itself describes the working, It compiles the code just in the time of loading the page in browser. The browser will download the compiler and build the application code and renders it.

    It will be good for development environment.

    AoT (Ahead of Time) Compilation

    It compiles all the code at the time of building the application. So the browser doesn't want to download the compiler and compile the code. In this method browser can easily render the application by just loading the already compiled code.

    Can be used in the production environment

    We can compare the JiT and AoT compilation as below

    0 讨论(0)
  • 2020-12-04 06:39

    There is actually only one Angular compiler. The difference between AOT and JIT is a matter of timing and tooling. With AOT, the compiler runs once at build time using one set of libraries; with JIT it runs every time for every user at runtime using a different set of libraries.

    0 讨论(0)
提交回复
热议问题