{"title":"The performance of object encodings in JavaScript","authors":"Forrest Alexander, A. Black","doi":"10.1145/3012408.3012417","DOIUrl":null,"url":null,"abstract":"We investigate how to represent objects when JavaScript is used as a compilation target. This is an interesting question because JavaScript is the target language of choice for compiler writers who wish to deploy to \"the Internet\", and because JavaScript offers many ways to say the same thing. We looked at three axes of variability: whether an object's methods are stored in the object itself, or in a prototype; whether the object uses Javascript's closures or builds its own, and whether an object's fields are accessed directly or via accessor methods. The results reveal that certain variations are more than a hundred times faster than others. We conclude that the particular choices we make may be critical.","PeriodicalId":186136,"journal":{"name":"Proceedings of the 11th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems","volume":"70 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 11th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3012408.3012417","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
We investigate how to represent objects when JavaScript is used as a compilation target. This is an interesting question because JavaScript is the target language of choice for compiler writers who wish to deploy to "the Internet", and because JavaScript offers many ways to say the same thing. We looked at three axes of variability: whether an object's methods are stored in the object itself, or in a prototype; whether the object uses Javascript's closures or builds its own, and whether an object's fields are accessed directly or via accessor methods. The results reveal that certain variations are more than a hundred times faster than others. We conclude that the particular choices we make may be critical.