{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,13]],"date-time":"2026-02-13T18:02:35Z","timestamp":1771005755095,"version":"3.50.1"},"reference-count":56,"publisher":"Association for Computing Machinery (ACM)","issue":"1","license":[{"start":{"date-parts":[[2022,12,16]],"date-time":"2022-12-16T00:00:00Z","timestamp":1671148800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/www.acm.org\/publications\/policies\/copyright_policy#Background"}],"funder":[{"DOI":"10.13039\/501100001809","name":"NSFC","doi-asserted-by":"crossref","award":["61832009, 62272214"],"award-info":[{"award-number":["61832009, 62272214"]}],"id":[{"id":"10.13039\/501100001809","id-type":"DOI","asserted-by":"crossref"}]},{"name":"Jiangsu Postgraduate Innovation Program","award":["KYCX20_0042"],"award-info":[{"award-number":["KYCX20_0042"]}]},{"name":"Cooperation Fund of Huawei\u2014Nanjing University Next Generation Programming Innovation Lab","award":["YBN2019105178SW32, YBN2019105178SW37"],"award-info":[{"award-number":["YBN2019105178SW32, YBN2019105178SW37"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["ACM Trans. Archit. Code Optim."],"published-print":{"date-parts":[[2023,3,31]]},"abstract":"<jats:p>Interpreters are widely used in the implementation of many programming languages, such as Python, Perl, and Java. Even though various JIT compilers emerge in an endless stream, interpretation efficiency still plays a critical role in program performance. Does a stack-based interpreter or a register-based interpreter perform better? The pros and cons of the pair of architectures have long been discussed. The stack architecture is attractive for its concise model and compact bytecode, but our study finds that the register-based interpreter can also be implemented easily and that its bytecode size only grows by a small margin. Moreover, the latter turns out to be appreciably faster. Specifically, we implemented an open source Python interpreter named RegCPython based on CPython v3.10.1. The former is register based, while the latter is stack based. Without changes in syntax, Application Programming Interface, and Application Binary Interface, RegCPython is excellently compatible with CPython, as it does not break existing syntax or interfaces. It achieves a speedup of 1.287 on the most favorable benchmark and 0.977 even on the most unfavorable benchmark. For all Python-intensive benchmarks, the average speedup reaches 1.120 on x86 and 1.130 on ARM. Our evaluation work, which also serves as an empirical study, provides a detailed performance survey of both interpreters on modern hardware. It points out that the register-based interpreters are more efficient mainly due to the elimination of machine instructions needed, while changes in branch mispredictions and cache misses have a limited impact on performance. Additionally, it confirms that the register-based implementation is also satisfactory in terms of memory footprint, compilation cost, and implementation complexity.<\/jats:p>","DOI":"10.1145\/3568973","type":"journal-article","created":{"date-parts":[[2022,10,21]],"date-time":"2022-10-21T13:00:26Z","timestamp":1666357226000},"page":"1-25","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":6,"title":["RegCPython: A Register-based Python Interpreter for Better Performance"],"prefix":"10.1145","volume":"20","author":[{"ORCID":"https:\/\/orcid.org\/0000-0003-0876-4374","authenticated-orcid":false,"given":"Qiang","family":"Zhang","sequence":"first","affiliation":[{"name":"Nanjing University, Nanjing, Jiangsu, China"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-4815-2850","authenticated-orcid":false,"given":"Lei","family":"Xu","sequence":"additional","affiliation":[{"name":"Nanjing University, Nanjing, Jiangsu, China"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-7743-1296","authenticated-orcid":false,"given":"Baowen","family":"Xu","sequence":"additional","affiliation":[{"name":"Nanjing University, Nanjing, Jiangsu, China"}]}],"member":"320","published-online":{"date-parts":[[2022,12,16]]},"reference":[{"key":"e_1_3_2_2_2","first-page":"213","volume-title":"Software Engineering (Workshops)","author":"Barany Gerg\u00f6","year":"2014","unstructured":"Gerg\u00f6 Barany. 2014. pylibjit: A JIT compiler library for Python. In Software Engineering (Workshops). CEUR-WS.org, Aachen, Germany, 213\u2013224."},{"key":"e_1_3_2_3_2","doi-asserted-by":"publisher","DOI":"10.1145\/2617548.2617552"},{"key":"e_1_3_2_4_2","doi-asserted-by":"publisher","DOI":"10.1145\/1460690.1460736"},{"key":"e_1_3_2_5_2","doi-asserted-by":"publisher","DOI":"10.1109\/MCSE.2010.118"},{"key":"e_1_3_2_6_2","doi-asserted-by":"publisher","DOI":"10.1145\/1534530.1534550"},{"key":"e_1_3_2_7_2","doi-asserted-by":"publisher","DOI":"10.1109\/CGO.2005.14"},{"key":"e_1_3_2_8_2","doi-asserted-by":"publisher","DOI":"10.1145\/1565824.1565827"},{"key":"e_1_3_2_9_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-37051-9_6"},{"key":"e_1_3_2_10_2","doi-asserted-by":"publisher","DOI":"10.1016\/j.entcs.2009.11.011"},{"key":"e_1_3_2_11_2","doi-asserted-by":"publisher","DOI":"10.1145\/1899661.1869633"},{"key":"e_1_3_2_12_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-14107-2_21"},{"key":"e_1_3_2_13_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-19861-8_10"},{"key":"e_1_3_2_14_2","volume-title":"Purely interpretative optimizations","author":"Brunthaler Stefan","year":"2011","unstructured":"Stefan Brunthaler. 2011. Purely interpretative optimizations. Ph.D. Dissertation. TU Wien."},{"key":"e_1_3_2_15_2","unstructured":"Stefan Brunthaler. 2021. Multi-level quickening: Ten years later. arXiv.2109.02958. Retrieved from https:\/\/arxiv.org\/abs\/2109.02958."},{"key":"e_1_3_2_16_2","doi-asserted-by":"publisher","DOI":"10.1145\/1186736.1186738"},{"key":"e_1_3_2_17_2","unstructured":"Community contributors. 2010. Unladen Swallow. Retreived from https:\/\/code.google.com\/archive\/p\/unladen-swallow\/."},{"key":"e_1_3_2_18_2","unstructured":"Community contributors. 2021. Pyston: Enhance Your Python. Retrieved from https:\/\/www.pyston.org\/."},{"key":"e_1_3_2_19_2","doi-asserted-by":"publisher","DOI":"10.1109\/IPDPS.2005.161"},{"key":"e_1_3_2_20_2","doi-asserted-by":"publisher","DOI":"10.1109\/IISWC50251.2020.00017"},{"key":"e_1_3_2_21_2","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-44681-8_59"},{"key":"e_1_3_2_22_2","doi-asserted-by":"publisher","DOI":"10.1145\/781131.781162"},{"key":"e_1_3_2_23_2","unstructured":"Greg Ewing. 2010. Pyrex\u2014A Language for Writing Python Extension Modules. Retrieved from https:\/\/www.csse.canterbury.ac.nz\/greg.ewing\/python\/Pyrex\/."},{"key":"e_1_3_2_24_2","doi-asserted-by":"publisher","DOI":"10.1109\/ISPASS.2006.1620789"},{"key":"e_1_3_2_25_2","unstructured":"Fabian Fagerholm. 2005. Perl 6 and the Parrot Virtual Machine."},{"key":"e_1_3_2_26_2","unstructured":"Ruijie Fang and Siqi Liu. 2016. A performance survey on stack-based and register-based virtual machines. arXiv:1611.00467. Retrieved from https:\/\/arxiv.org\/abs\/1611.00467."},{"key":"e_1_3_2_27_2","doi-asserted-by":"publisher","DOI":"10.1145\/5666.5673"},{"key":"e_1_3_2_28_2","unstructured":"Geoffrey Garen. 2008. Announcing SquirrelFish. Retrieved from https:\/\/webkit.org\/blog\/189\/announcing-squirrelfish\/."},{"key":"e_1_3_2_29_2","unstructured":"Isaac Gouy. 2021. The Computer Language Benchmarks Game. Retrieved from https:\/\/benchmarksgame-team.pages.debian.net\/benchmarksgame."},{"key":"e_1_3_2_30_2","doi-asserted-by":"publisher","DOI":"10.1016\/j.scico.2004.08.005"},{"key":"e_1_3_2_31_2","doi-asserted-by":"publisher","DOI":"10.1109\/MCSE.2018.021651342"},{"key":"e_1_3_2_32_2","doi-asserted-by":"publisher","DOI":"10.5555\/540137"},{"key":"e_1_3_2_33_2","unstructured":"Kay Hayen and community contributors. 2022. Nuitka the Python Compiler. Retrieved from https:\/\/nuitka.net."},{"issue":"7","key":"e_1_3_2_34_2","first-page":"1159","article-title":"The implementation of Lua 5.0.","volume":"11","author":"Ierusalimschy Roberto","year":"2005","unstructured":"Roberto Ierusalimschy, Luiz Henrique De Figueiredo, and Waldemar Celes Filho. 2005. The implementation of Lua 5.0. J. Univ. Comput. Sci. 11, 7 (2005), 1159\u20131176.","journal-title":"J. Univ. Comput. Sci."},{"key":"e_1_3_2_35_2","doi-asserted-by":"publisher","DOI":"10.1109\/IISWC.2018.8573512"},{"key":"e_1_3_2_36_2","doi-asserted-by":"publisher","DOI":"10.1145\/2833157.2833162"},{"key":"e_1_3_2_37_2","unstructured":"Linus Lee. 2020. Interesting Things about the Lua Interpreter. Retrieved from https:\/\/thesephist.com\/posts\/lua\/."},{"key":"e_1_3_2_38_2","doi-asserted-by":"publisher","DOI":"10.1109\/CSE.2014.142"},{"key":"e_1_3_2_39_2","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.1976.233837"},{"key":"e_1_3_2_40_2","unstructured":"Ross McIlroy. 2016. Firing up the Ignition Interpreter. Retrieved from https:\/\/v8.dev\/blog\/ignition-interpreter."},{"key":"e_1_3_2_41_2","volume-title":"Understanding the Potential of Interpreter-based Optimizations for Python","author":"Mostafa Nagy","year":"2010","unstructured":"Nagy Mostafa, Chandra Krintz, Calin Cascaval, David Edelsohn, Priya Nagpurkar, and Peng Wu. 2010. Understanding the Potential of Interpreter-based Optimizations for Python. Technical Report 2010-14. UC Santa Barbara Computer Science."},{"key":"e_1_3_2_42_2","doi-asserted-by":"publisher","DOI":"10.1145\/605432.605404"},{"key":"e_1_3_2_43_2","doi-asserted-by":"publisher","DOI":"10.1145\/2388936.2388956"},{"key":"e_1_3_2_44_2","doi-asserted-by":"publisher","DOI":"10.1109\/ISSCC.2018.8310168"},{"key":"e_1_3_2_45_2","unstructured":"Russell Power and Alex Rubinsteyn. 2013. How fast can we make interpreted Python? arXiv:1306.6047. Retrieved from https:\/\/arxiv.org\/abs\/1306.6047."},{"key":"e_1_3_2_46_2","unstructured":"Python Software Foundation. 2021. The Python Performance Benchmark Suite. Retrieved from https:\/\/github.com\/python\/pyperformance."},{"key":"e_1_3_2_47_2","unstructured":"Python Software Foundation. 2021. This is Python Version 3.10.1. Retrieved from https:\/\/github.com\/python\/cpython."},{"key":"e_1_3_2_48_2","doi-asserted-by":"publisher","DOI":"10.1109\/MS.2014.104"},{"key":"e_1_3_2_49_2","doi-asserted-by":"publisher","DOI":"10.1145\/1014007.1014010"},{"key":"e_1_3_2_50_2","doi-asserted-by":"publisher","DOI":"10.1145\/1176617.1176753"},{"key":"e_1_3_2_51_2","doi-asserted-by":"publisher","DOI":"10.1109\/CGO.2015.7054191"},{"key":"e_1_3_2_52_2","unstructured":"Anthony Shaw and community contributors. 2022. Pyjion: A Drop-in JIT Compiler for Python 3.10. Retrieved from https:\/\/www.trypyjion.com\/."},{"key":"e_1_3_2_53_2","doi-asserted-by":"publisher","DOI":"10.1145\/1328195.1328197"},{"key":"e_1_3_2_54_2","doi-asserted-by":"publisher","DOI":"10.1145\/63039.63043"},{"key":"e_1_3_2_55_2","unstructured":"TIOBE Software. 2022. TIOBE Index. Retrieved from https:\/\/www.tiobe.com\/tiobe-index."},{"key":"e_1_3_2_56_2","doi-asserted-by":"publisher","DOI":"10.5555\/271581.271584"},{"key":"e_1_3_2_57_2","doi-asserted-by":"publisher","DOI":"10.1016\/j.scico.2021.102759"}],"container-title":["ACM Transactions on Architecture and Code Optimization"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3568973","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3568973","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T17:49:10Z","timestamp":1750182550000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3568973"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2022,12,16]]},"references-count":56,"journal-issue":{"issue":"1","published-print":{"date-parts":[[2023,3,31]]}},"alternative-id":["10.1145\/3568973"],"URL":"https:\/\/doi.org\/10.1145\/3568973","relation":{},"ISSN":["1544-3566","1544-3973"],"issn-type":[{"value":"1544-3566","type":"print"},{"value":"1544-3973","type":"electronic"}],"subject":[],"published":{"date-parts":[[2022,12,16]]},"assertion":[{"value":"2022-04-08","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2022-10-04","order":1,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2022-12-16","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}