Skip to main content
Kent Academic Repository

Optimizing the Order of Bytecode Handlers in Interpreters using a Genetic Algorithm

Huang, Wanhong, Marr, Stefan, Ugawa, Tomoharu (2023) Optimizing the Order of Bytecode Handlers in Interpreters using a Genetic Algorithm. In: The 38th ACM/SIGAPP Symposium on Applied Computing (SAC '23). . ACM ISBN 978-1-4503-9517-5. (doi:10.1145/3555776.3577712) (KAR id:99544)

Abstract

Interpreter performance remains important today. Interpreters are needed in resource constrained systems, and even in systems with just-in-time compilers, they are crucial during warm up. A common form of interpreters is a bytecode interpreter, where the interpreter executes bytecode instructions one by one. Each bytecode is executed by the corresponding bytecode handler. In this paper, we show that the order of the bytecode handlers in the interpreter source code affects the execution performance of programs on the interpreter. On the basis of this observation, we propose a genetic algorithm (GA) approach to find an approximately optimal order. In our GA approach, we find an order optimized for a specific benchmark program and a specific CPU. We evaluated the effectiveness of our approach on various models of CPUs including x86 processors and an ARM processor. The order found using GA improved the execution speed of the program for which the order was optimized between 0.8% and 23.0% with 7.7% on average. We also assess the cross-benchmark and cross-machine performance of the GA-found order. Some orders showed good generalizability across benchmarks, speeding up all benchmark programs. However, the solutions do not generalize across different machines, indicating that they are highly specific to a microarchitecture.

Item Type: Conference or workshop item (Proceeding)
DOI/Identification number: 10.1145/3555776.3577712
Additional information: For the purpose of open access, the author has applied a CC BY public copyright licence to any Author Accepted Manuscript version arising from this submission.
Uncontrolled keywords: Interpreters, Genetic Algorithm, Code Layout, JavaScript, Embedded Systems
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
Funders: Japan Society for the Promotion of Science (https://ror.org/02m7axw05)
Engineering and Physical Sciences Research Council (https://ror.org/0439y7842)
Royal Society (https://ror.org/03wnrjx87)
Depositing User: Stefan Marr
Date Deposited: 17 Jan 2023 10:56 UTC
Last Modified: 18 Sep 2023 22:14 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/99544 (The current URI for this page, for reference purposes)

University of Kent Author Information

  • Depositors only (login required):

Total unique views for this document in KAR since July 2020. For more details click on the image.