Tree shaking
≈ 2 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
In computing, tree shaking is a dead code elimination technique that is applied when bundling code with its dependencies. It is most commonly applied to dynamic languages, in practice most commonly JavaScript/ECMAScript. Often contrasted with traditional single-library dead code elimination techniques common to minifiers, tree shaking eliminates unused functions from across the bundle by starting at the entry point and only including functions that may be executed. It is succinctly described as "live code inclusion". In less-dynamic languages such as C, ordinary dead-code elimination becomes equivalent to tree-shaking with whole program optimization, which also uses knowledge of entry points.
In computing, tree shaking is a dead code elimination technique that is applied when bundling code with its dependencies. It is most commonly applied to dynamic languages, in practice most commonly JavaScript/ECMAScript. Often contrasted with traditional single-library dead code elimination techniques common to minifiers, tree shaking eliminates unused functions from across the bundle by starting at the entry point and only including functions that may be executed. It is succinctly described as "live code inclusion". In less-dynamic languages such as C, ordinary dead-code elimination becomes equivalent to tree-shaking with whole program optimization, which also uses knowledge of entry points.
Text derived from https://en.wikipedia.org/w/index.php?oldid=1365118818 under CC BY-SA 4.0; modifications have been made.