- Mastering Node.js(Second Edition)
- Sandro Pasquali Kevin Faaborg
- 85字
- 2021-07-02 19:28:40
Functions
Functions are typically called often, and should be one of your prime optimization focuses. Functions containing try-catch constructs are not optimizable, nor are functions containing other unpredictable constructs, like with or eval. If, for some reason, your function is not optimizable, keep its use to a minimum.
A very common optimization error involves the use of polymorphic functions. Functions that accept variable function arguments will be de-optimized. Avoid polymorphic functions.
An excellent explanation of how V8 performs speculative optimization can be found here: https://ponyfoo.com/articles/an-introduction-to-speculative-optimization-in-v8
推薦閱讀
- Cisco OSPF命令與配置手冊(cè)
- 網(wǎng)絡(luò)協(xié)議工程
- 智能網(wǎng)聯(lián)汽車V2X與智能網(wǎng)聯(lián)設(shè)施I2X
- 物聯(lián)網(wǎng)安全:理論、實(shí)踐與創(chuàng)新
- HTML5 Game development with ImpactJS
- SSL VPN : Understanding, evaluating and planning secure, web/based remote access
- Mastering JavaFX 10
- 世界互聯(lián)網(wǎng)發(fā)展報(bào)告·2019
- 區(qū)塊鏈輕松上手:原理、源碼、搭建與應(yīng)用
- Building RESTful Web services with Go
- Echo Quick Start Guide
- 沖擊:5G如何改變世界
- Implementing NetScaler VPX?
- 物聯(lián)網(wǎng)的機(jī)遇與利用
- 中國互聯(lián)網(wǎng)發(fā)展報(bào)告2021