{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,22]],"date-time":"2026-10-22T01:07:28Z","timestamp":1792631248256,"version":"4.5.0"},"reference-count":35,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA","license":[{"start":{"date-parts":[[2020,11,13]],"date-time":"2020-11-13T00:00:00Z","timestamp":1605225600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/100000001","name":"National Science Foundation","doi-asserted-by":"publisher","award":["1759736,1925644,1618732"],"award-info":[{"award-number":["1759736,1925644,1618732"]}],"id":[{"id":"10.13039\/100000001","id-type":"DOI","asserted-by":"publisher"}]},{"DOI":"10.13039\/100000006","name":"Office of Naval Research","doi-asserted-by":"publisher","award":["503353"],"award-info":[{"award-number":["503353"]}],"id":[{"id":"10.13039\/100000006","id-type":"DOI","asserted-by":"publisher"}]},{"name":"Czech Ministry of Education, Youth and Sports from the Czech Operational Programme Research, Development, and Education","award":["CZ.02.1.01\/0.0\/0.0\/15_003\/0000421"],"award-info":[{"award-number":["CZ.02.1.01\/0.0\/0.0\/15_003\/0000421"]}]},{"DOI":"10.13039\/501100000781","name":"European Research Council","doi-asserted-by":"publisher","award":["695412"],"award-info":[{"award-number":["695412"]}],"id":[{"id":"10.13039\/501100000781","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2020,11,13]]},"abstract":"<jats:p>In order to generate efficient code, dynamic language compilers often need information, such as dynamic types, not readily available in the program source. Leveraging a mixture of static and dynamic information, these compilers speculate on the missing information. Within one compilation unit, they specialize the generated code to the previously observed behaviors, betting that past is prologue. When speculation fails, the execution must jump back to unoptimized code. In this paper, we propose an approach to further the specialization, by disentangling classes of behaviors into separate optimization units. With contextual dispatch, functions are versioned and each version is compiled under different assumptions. When a function is invoked, the implementation dispatches to a version optimized under assumptions matching the dynamic context of the call. As a proof-of-concept, we describe a compiler for the R language which uses this approach. Our implementation is, on average, 1.7\u00d7 faster than the GNU R reference implementation. We evaluate contextual dispatch on a set of benchmarks and measure additional speedup, on top of traditional speculation with deoptimization techniques. In this setting contextual dispatch improves the performance of 18 out of 46 programs in our benchmark suite.<\/jats:p>","DOI":"10.1145\/3428288","type":"journal-article","created":{"date-parts":[[2020,11,24]],"date-time":"2020-11-24T23:36:06Z","timestamp":1606260966000},"page":"1-24","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":18,"title":["Contextual dispatch for function specialization"],"prefix":"10.1145","volume":"4","author":[{"ORCID":"https:\/\/orcid.org\/0000-0003-0512-9607","authenticated-orcid":false,"given":"Olivier","family":"Fl\u00fcckiger","sequence":"first","affiliation":[{"name":"Northeastern University, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Guido","family":"Chari","sequence":"additional","affiliation":[{"name":"Asapp, Argentina"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Ming-Ho","family":"Yee","sequence":"additional","affiliation":[{"name":"Northeastern University, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jan","family":"Je\u010dmen","sequence":"additional","affiliation":[{"name":"Czech Technical University, Czechia"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jakob","family":"Hain","sequence":"additional","affiliation":[{"name":"Northeastern University, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-4052-3458","authenticated-orcid":false,"given":"Jan","family":"Vitek","sequence":"additional","affiliation":[{"name":"Northeastern University, USA \/ Czech Technical University, Czechia"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2020,11,13]]},"reference":[{"key":"e_1_2_2_1_1","doi-asserted-by":"publisher","DOI":"10.1109\/SAMOS.2017.8344624"},{"key":"e_1_2_2_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/3133876"},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3276490"},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/286942.286958"},{"key":"e_1_2_2_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/73141.74831"},{"key":"e_1_2_2_6_1","doi-asserted-by":"publisher","DOI":"10.4230\/LIPIcs.ECOOP.2015.101"},{"key":"e_1_2_2_7_1","doi-asserted-by":"publisher","DOI":"10.1016\/0096-0551(93)90005-L"},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1109\/CGO.2013.6495006"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/223428.207119"},{"key":"e_1_2_2_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/1565824.1565830"},{"key":"e_1_2_2_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/3359619.3359744"},{"key":"e_1_2_2_12_1","doi-asserted-by":"publisher","DOI":"10.5281\/zenodo.3973073"},{"key":"e_1_2_2_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/3158137"},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/1542476.1542528"},{"key":"e_1_2_2_15_1","unstructured":"Isaac Gouy. 2020. Computer Language Benchmarks Game. https:\/\/benchmarksgame-team.pages. debian.net\/ benchmarksgame\/  Isaac Gouy. 2020. Computer Language Benchmarks Game. https:\/\/benchmarksgame-team.pages. debian.net\/ benchmarksgame\/"},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/2254064.2254094"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0057013"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/143095.143114"},{"key":"e_1_2_2_20_1","volume-title":"International Workshop on Persistent Object Systems.","author":"Hosking Antony L","year":"1990","unstructured":"Antony L Hosking , J Eliot , and B Moss . 1990 . Towards compile-time optimisations for persistence . In International Workshop on Persistent Object Systems. Antony L Hosking, J Eliot, and B Moss. 1990. Towards compile-time optimisations for persistence. In International Workshop on Persistent Object Systems."},{"key":"e_1_2_2_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/2576195.2576205"},{"key":"e_1_2_2_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/378795.378797"},{"key":"e_1_2_2_23_1","doi-asserted-by":"publisher","DOI":"10.1109\/CGO.2004.1281665"},{"key":"e_1_2_2_24_1","doi-asserted-by":"crossref","unstructured":"Friedrich Leisch. 2006. A Toolbox for K-Centroids Cluster Analysis. Computational Statistics and Data Analysis 51 2 ( 2006 ).  Friedrich Leisch. 2006. A Toolbox for K-Centroids Cluster Analysis. Computational Statistics and Data Analysis 51 2 ( 2006 ).","DOI":"10.1016\/j.csda.2005.10.006"},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/3314221.3314611"},{"key":"e_1_2_2_26_1","doi-asserted-by":"publisher","DOI":"10.5281\/zenodo.1311762"},{"key":"e_1_2_2_27_1","doi-asserted-by":"publisher","DOI":"10.1145\/2989225.2989232"},{"key":"e_1_2_2_28_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-31057-7_6"},{"key":"e_1_2_2_29_1","volume-title":"The Java Hotspot Server Compiler. In Symposium on Java Virtual Machine Research and Technology (JVM).","author":"Paleczny Michael","year":"2001","unstructured":"Michael Paleczny , Christopher Vick , and Clif Click . 2001 . The Java Hotspot Server Compiler. In Symposium on Java Virtual Machine Research and Technology (JVM). Michael Paleczny, Christopher Vick, and Clif Click. 2001. The Java Hotspot Server Compiler. In Symposium on Java Virtual Machine Research and Technology (JVM)."},{"key":"e_1_2_2_30_1","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0014224"},{"key":"e_1_2_2_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/3428235"},{"key":"e_1_2_2_32_1","volume-title":"R: A Language and Environment for Statistical Computing. https:\/\/www.R-project.org","author":"Team R Core","year":"2019","unstructured":"R Core Team . 2019 . R: A Language and Environment for Statistical Computing. https:\/\/www.R-project.org R Core Team. 2019. R: A Language and Environment for Statistical Computing. https:\/\/www.R-project.org"},{"key":"e_1_2_2_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/359810.359830"},{"key":"e_1_2_2_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/2989225.2989236"},{"key":"e_1_2_2_35_1","doi-asserted-by":"publisher","DOI":"10.1145\/2370816.2370825"},{"key":"e_1_2_2_36_1","unstructured":"Luke Tierney. 2019. A Byte Code Compiler for R. www.stat.uiowa.edu\/~luke\/R\/compiler\/compiler.pdf  Luke Tierney. 2019. A Byte Code Compiler for R. www.stat.uiowa.edu\/~luke\/R\/compiler\/compiler.pdf"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3428288","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3428288","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3428288","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T22:02:58Z","timestamp":1750197778000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3428288"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2020,11,13]]},"references-count":35,"journal-issue":{"issue":"OOPSLA","published-print":{"date-parts":[[2020,11,13]]}},"alternative-id":["10.1145\/3428288"],"URL":"https:\/\/doi.org\/10.1145\/3428288","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2020,11,13]]},"assertion":[{"value":"2020-11-13","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}