- Script
- Model
- Event
- Dom
- Render Process
- Repaint
- Reflow
- defer
- Not every browser exec script with defer attribute in the last one.
- Load script and parse document simultaneously and load the script after the document has been pared.
- async
- Async load script and execute immediately if document has not yet been pared. Otherwise, the script will be blocked until document has been pared.
- Order is not predictable when loading multiple scripts with async
- Dynamically create DOM
- e.g. Load JS after document.onload
- setTimeout
- Load JS after main context
白屏时间: 第一個元素出現 首屏时间: 第一屏喧染完成 Ref. Web 性能优化-首屏和白屏时间