Dead Code Removal at Meta: Automatically Deleting Millions of Lines of Code and Petabytes of Deprecated Data
Authors:
- Will ShackletonWSWill Shackleton
- Katriel Cohn-GordonKCKatriel Cohn-Gordon
- Peter C. RigbyPRPeter C. Rigby
- Rui AbreuRARui Abreu
- James GillJGJames Gill
- Nachiappan NagappanNNNachiappan Nagappan
- Karim NakadKNKarim Nakad
- Ioannis PapagiannisIPIoannis Papagiannis
- Luke PetreLPLuke Petre
- Giorgi MegreliGMGiorgi Megreli
- Patrick RiggsPRPatrick Riggs
- James SaindonJSJames Saindon
Open Access
- 30 November 2023
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 1705-1715
Abstract
Software constantly evolves in response to user needs: new features are built, deployed, mature and grow old, and eventually their usage drops enough to merit switching them off. In any large codebase, this feature lifecycle can naturally lead to retaining unnecessary code and data. Removing these respects users’ privacy expectations, as well as helping engineers to work efficiently. In prior software engineering research, we have found little evidence of code deprecation or dead-code removal at industrial scale. We describe Systematic Code and Asset Removal Framework (SCARF), a product deprecation system to assist engineers working in large codebases. SCARF identifies unused code and data assets and safely removes them. It operates fully automatically, including committing code and dropping database tables. It also gathers developer input where it cannot take automated actions, leading to further removals. Dead code removal increases the quality and consistency of large codebases, aids with knowledge management and improves reliability. SCARF has had an important impact at Meta. In the last year alone, it has removed petabytes of data across 12.8 million distinct assets, and deleted over 104 million lines of code.Keywords
This publication has 12 references indexed in Scilit:
- RocksDB: Evolution of Development Priorities in a Key-value Store Serving Large-scale ApplicationsACM Transactions on Storage, 2021
- Code smells and refactoring: A tertiary systematic review of challenges and observationsJournal of Systems and Software, 2020
- Piranha2020
- CARVE2019
- Feature toggles2016
- Development and Deployment at FacebookIEEE Internet Computing, 2013
- Hive - a petabyte scale data warehouse using Hadoop2010
- Preprocessor conditional removal by simple partial evaluation2002
- DMS2002
- A C++ data model supporting reachability analysis and dead code detectionIEEE Transactions on Software Engineering, 1998