Constraint based optimization of stationary fields

Ian Rogers, Jisheng Zhao, C. Kirkham, I. Watson
{"title":"Constraint based optimization of stationary fields","authors":"Ian Rogers, Jisheng Zhao, C. Kirkham, I. Watson","doi":"10.1145/1411732.1411746","DOIUrl":null,"url":null,"abstract":"In many scenarios a field holds a value that is constant beyond a certain point in the execution of the program. However, Java only allows it to be marked as being final in relation to the control-flow of the program. We present a language extension whereby the programmer can express that a field will have an unchanging value once it satisfies a given constraint. That is the constraint is the guarantee of finality as opposed to the particular code region. A field holding an unchanging value is said to be stationary. The resulting change of the language has similar pitfalls to keywords that express immutability in a dynamic system. However, it provides a number of advantages: ability for improved partial evaluation and specialisation in dynamic compilation, simple inspection to show thread safety and richer information to the runtime environment.\n We present an implementation of our proposed language extension to Java in the Jikes Research Virtual Machine (RVM). We use class loading as a case study of where lazy initialisation occurs. In code that is frequently executed the probability of a referenced class being uninitialised is less than 1% for method accesses and for fields typically 0%. We create an optimization framework that uses this information to perform specialisation and partial evaluation. We demonstrate that on average 61.32% of accesses occur to fields in their stationary state. We demonstrate that stationary information allows optimizations achieving a best case 3.90% speedup of benchmark applications, and 1.67% speedup on average.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"33 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2008-09-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Principles and Practice of Programming in Java","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1411732.1411746","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

In many scenarios a field holds a value that is constant beyond a certain point in the execution of the program. However, Java only allows it to be marked as being final in relation to the control-flow of the program. We present a language extension whereby the programmer can express that a field will have an unchanging value once it satisfies a given constraint. That is the constraint is the guarantee of finality as opposed to the particular code region. A field holding an unchanging value is said to be stationary. The resulting change of the language has similar pitfalls to keywords that express immutability in a dynamic system. However, it provides a number of advantages: ability for improved partial evaluation and specialisation in dynamic compilation, simple inspection to show thread safety and richer information to the runtime environment. We present an implementation of our proposed language extension to Java in the Jikes Research Virtual Machine (RVM). We use class loading as a case study of where lazy initialisation occurs. In code that is frequently executed the probability of a referenced class being uninitialised is less than 1% for method accesses and for fields typically 0%. We create an optimization framework that uses this information to perform specialisation and partial evaluation. We demonstrate that on average 61.32% of accesses occur to fields in their stationary state. We demonstrate that stationary information allows optimizations achieving a best case 3.90% speedup of benchmark applications, and 1.67% speedup on average.
基于约束的稳态场优化
在许多情况下,字段保存的值在程序执行的某一点之外是恒定的。然而,Java只允许将其标记为与程序的控制流相关的final。我们提供了一种语言扩展,程序员可以通过它表示,一旦满足给定的约束,字段将具有不变的值。也就是说,约束是最终性的保证,而不是特定的代码区域。具有不变值的场称为平稳场。语言的最终变化与动态系统中表达不变性的关键字具有类似的缺陷。然而,它提供了许多优点:改进部分求值和动态编译专门化的能力,显示线程安全性的简单检查以及向运行时环境提供更丰富的信息。我们在Jikes Research虚拟机(RVM)中实现了我们提出的语言扩展到Java。我们使用类加载作为延迟初始化发生的案例研究。在频繁执行的代码中,被引用的类未初始化的概率对于方法访问小于1%,对于字段通常小于0%。我们创建了一个优化框架,使用这些信息来执行专门化和部分求值。我们证明了平均61.32%的访问发生在稳态的场。我们证明,平稳信息允许优化实现基准应用程序的最佳加速3.90%,平均加速1.67%。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信