Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Dead-code elimination
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Compiler optimization to remove code which does not affect the program results}} {{Use dmy dates|date=April 2019|cs1-dates=y}} {{Use list-defined references|date=December 2021}} In [[compiler theory]], '''dead-code elimination''' ('''DCE''', '''dead-code removal''', '''dead-code stripping''', or '''dead-code strip''') is a [[compiler optimization]] to remove [[dead code]] (code that does not affect the program results). Removing such code has several benefits: it shrinks [[executable|program]] size, an important consideration in some contexts, it reduces resource usage such as the number of bytes to be transferred<ref>Malavolta, Ivano et al. “JavaScript Dead Code Identification, Elimination, and Empirical Assessment.” IEEE transactions on software engineering 49.7 (2023): 3692–3714. Web.</ref> and it allows the running program to avoid executing irrelevant [[CPU instruction|operations]], which reduces its [[execution (computing)|running time]]. It can also enable further optimizations by simplifying program structure. Dead code includes code that can never be executed ([[unreachable code]]), and code that only affects [[dead variable]]s (written to, but never read again), that is, irrelevant to the program.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)