V2EX  ›  英汉词典

Dead Code Elimination

定义 / Definition

死代码消除:编译器(或静态分析工具)中的一种优化,用于删除对程序输出与可观察行为没有影响的代码(例如永远不会执行的语句、计算了但结果从未被使用的表达式等),以减少程序体积并可能提升性能。(在并发、I/O、异常、反射等存在“副作用”或可观察行为的场景下,判定会更谨慎。)

例句 / Examples

The compiler performed dead code elimination to remove unused calculations.
编译器进行了死代码消除,移除了未被使用的计算。

After inlining and constant propagation, dead code elimination removed an entire branch that could never be reached, reducing both runtime checks and binary size.
在函数内联与常量传播之后,死代码消除移除了一个永远不可能到达的分支,从而减少了运行时检查并缩小了二进制体积。

发音 / Pronunciation (IPA)

/dɛd koʊd ɪˌlɪməˈneɪʃən/

词源 / Etymology

该术语由三部分组成:dead(“无效的、不会发生作用的”)、code(代码)、elimination(消除)。在编译原理语境中,“dead”并非“坏代码”,而是指对程序结果没有贡献不可达的代码片段;“elimination”强调通过分析后将其从中间表示或最终输出中删除。

相关词 / Related Words

文学与经典出处 / Notable Works

  • Compilers: Principles, Techniques, and Tools(《编译原理》,常称“龙书”)——在优化章节讨论包括死代码消除在内的多种编译优化。
  • Engineering a Compiler(Keith Cooper & Linda Torczon)——以工程视角系统讲解死代码消除与数据流分析的关系。
  • Modern Compiler Implementation(Andrew W. Appel)——在中间代码优化与控制流图相关章节中涉及死代码消除。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   806 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 22:56 · PVG 06:56 · LAX 14:56 · JFK 17:56
♥ Do have faith in what you're doing.