Analyzing per-component energy consumption of evolutionary algorithms implemented in low-level languages: Comparison of C++ and zig in key evolutionary algorithm functions
Trying to design software systems in such a way that they consume a minimal amount of energy is simply good engineering practice. Scientific software is no exception; in this case, we will put our focus on evolutionary algorithms and the energy consumption patterns in memory and CPU for two different, low-level languages: The mainstream C++ and the emerging zig. By setting up a methodology that gives us a precise measure of the energy spent by key evolutionary algorithm functions, we can give the scientific software engineer some actionable insights on how to write energy-conscious, and thus energy-thrifty, evolutionary algorithms. Our experiments show that, even with very low energy consumption in both cases, C++ can achieve a significant reduction in energy consumption for some integer-based fitness functions, as well as very good performance on classical genetic operators. Besides, the experimental results have a low variability, as compared to zig, making it in the short and medium run the best of the two languages for evolutionary algorithms.
Authors
- G. Romero (ORCID: https://orcid.org/0000-0002-5498-7512)
- J. J. Merelo (ORCID: https://orcid.org/0000-0002-1385-9741)
- Mario García-Valdéz (ORCID: https://orcid.org/0000-0002-2593-1114)
Institutions
- Universidad de Granada (ES)
- Instituto Tecnológico de Tijuana (MX)
Publication Details
- Journal
- Proceedings of the Genetic and Evolutionary Computation Conference Companion
- Published
- 2025-07-14
- DOI
- https://doi.org/10.1145/3712255.3726694
- Primary Topic
- Evolutionary Algorithms and Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00