Tag

Dead Code Elimination

0 views collected around this technical thread.

Sohu Tech Products
Sohu Tech Products
Jan 15, 2025 · Frontend Development

Tree Shaking in React.js: Principles, Best Practices and Applications

Tree shaking in React.js leverages ES6 static imports and named exports to eliminate dead code, reducing bundle size and improving load performance, while best practices such as modular design, avoiding side effects and dynamic imports ensure optimal dead‑code elimination across components and libraries.

Dead Code EliminationES6 ModulesReact.js
0 likes · 7 min read
Tree Shaking in React.js: Principles, Best Practices and Applications
Architecture Development Notes
Architecture Development Notes
Aug 15, 2024 · Fundamentals

How Go’s Compiler Shrinks Binaries with Dead Code Elimination

This article explains Go’s dead code elimination (DCE) optimization, demonstrates it with sample code, shows how to inspect compiled binaries using go tool nm, and discusses factors that affect DCE such as code complexity, compiler flags, and reflection, helping developers reduce binary size.

Binary SizeCompiler OptimizationDead Code Elimination
0 likes · 6 min read
How Go’s Compiler Shrinks Binaries with Dead Code Elimination
ByteDance Web Infra
ByteDance Web Infra
May 13, 2022 · Frontend Development

Understanding Tree Shaking, Dead Code Elimination, and Side Effects in JavaScript Bundlers

Tree shaking, a subset of dead‑code elimination based on ES2015 module syntax, removes unused top‑level code, while side‑effect analysis determines which modules can be safely omitted; this article explains the terminology, algorithms, safety vs optimization trade‑offs, and practical debugging steps for modern JavaScript bundlers.

Dead Code EliminationJavaScript bundlersOptimization
0 likes · 19 min read
Understanding Tree Shaking, Dead Code Elimination, and Side Effects in JavaScript Bundlers
ByteFE
ByteFE
Aug 31, 2021 · Frontend Development

Understanding Tree Shaking in Webpack: Theory, Implementation, and Best Practices

This article explains the concept of Tree Shaking as a dead‑code elimination technique based on ES Modules, details how to enable it in Webpack, describes the underlying implementation steps, and provides practical tips for writing tree‑shakable code while avoiding common pitfalls.

Dead Code EliminationESMWebpack
0 likes · 14 min read
Understanding Tree Shaking in Webpack: Theory, Implementation, and Best Practices
JD Tech
JD Tech
Mar 5, 2019 · Frontend Development

Optimizing Taro H5 Bundle Size with Tree Shaking and ES Module Refactoring

This article explains how Taro's H5 build size was dramatically reduced by applying dead‑code elimination, configuring sideEffects, converting component and API packages to ES modules, and using webpack's tree‑shaking together with a custom Babel plugin to replace default imports with named imports.

Babel PluginDead Code EliminationES Modules
0 likes · 11 min read
Optimizing Taro H5 Bundle Size with Tree Shaking and ES Module Refactoring