Optimizing floating point operations in Scheme

W.F. Wong
{"title":"Optimizing floating point operations in Scheme","authors":"W.F. Wong","doi":"10.1016/S0096-0551(99)00007-7","DOIUrl":null,"url":null,"abstract":"<div><p>It is well known that dynamic typing in languages like Lisp is costly in terms of performance. Besides the cost of tag checking, the other major source of inefficiency comes from the need to place and retrieve data from dynamically allocated objects, i.e. <em>boxing</em> and <em>unboxing</em>. This makes it unacceptable in general to write numerical code in Lisp. Such programs involve “tight” loops in which boxing, unboxing and tag checking will dominate the computation time. With advances in the compilation of Lisp programs, it has been suggested that type checking and inference can be used to alleviate the problem. In this paper we shall examine a sub-problem, namely using type inference to aid compilation of numerical intensive Lisp code. A type inference algorithm for floating point operations will be described. This has been implemented in a Scheme compiler. Implementation issues and performance results on fairly large numerical code will also be reported. The results suggest that significant performance gains can be obtained. It is our hope that as an augmentation to other general type inferencing scheme, it will contribute towards the realization of highly optimizing Scheme compilers.</p></div>","PeriodicalId":100315,"journal":{"name":"Computer Languages","volume":"25 2","pages":"Pages 89-112"},"PeriodicalIF":0.0000,"publicationDate":"1999-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0096-0551(99)00007-7","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer Languages","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0096055199000077","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

It is well known that dynamic typing in languages like Lisp is costly in terms of performance. Besides the cost of tag checking, the other major source of inefficiency comes from the need to place and retrieve data from dynamically allocated objects, i.e. boxing and unboxing. This makes it unacceptable in general to write numerical code in Lisp. Such programs involve “tight” loops in which boxing, unboxing and tag checking will dominate the computation time. With advances in the compilation of Lisp programs, it has been suggested that type checking and inference can be used to alleviate the problem. In this paper we shall examine a sub-problem, namely using type inference to aid compilation of numerical intensive Lisp code. A type inference algorithm for floating point operations will be described. This has been implemented in a Scheme compiler. Implementation issues and performance results on fairly large numerical code will also be reported. The results suggest that significant performance gains can be obtained. It is our hope that as an augmentation to other general type inferencing scheme, it will contribute towards the realization of highly optimizing Scheme compilers.

查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
在Scheme中优化浮点运算
众所周知,像Lisp这样的语言中的动态类型在性能方面代价很高。除了标签检查的成本之外,效率低下的另一个主要来源来自需要从动态分配的对象中放置和检索数据,即装箱和拆箱。这使得在Lisp中编写数字代码通常是不可接受的。这类程序涉及“紧密”循环,其中装箱、拆箱和标签检查将主导计算时间。随着Lisp程序编译的进步,有人建议可以使用类型检查和推断来缓解这个问题。在本文中,我们将研究一个子问题,即使用类型推断来帮助编译数字密集型Lisp代码。本文将描述浮点运算的类型推断算法。这已经在Scheme编译器中实现了。还将报告在相当大的数字代码上的实现问题和性能结果。结果表明,可以获得显著的性能提升。我们希望,作为对其他一般类型推断方案的增强,它将有助于实现高度优化的scheme编译器。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
State inference for dynamically changing interfaces LAILA: a language for coordinating abductive reasoning among logic agents Index to Volume 27, 2001 Argos: an automaton-based synchronous language Visual temporal logic as a rapid prototyping tool
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1