Cache and I/O efficent functional algorithms

Author:

Blelloch Guy E.1,Harper Robert1

Affiliation:

1. Carnegie Mellon University, Pittsburgh, PA, USA

Abstract

The widely studied I/O and ideal-cache models were developed to account for the large difference in costs to access memory at different levels of the memory hierarchy. Both models are based on a two level memory hierarchy with a fixed size primary memory(cache) of size M, an unbounded secondary memory organized in blocks of size B. The cost measure is based purely on the number of block transfers between the primary and secondary memory. All other operations are free. Many algorithms have been analyzed in these models and indeed these models predict the relative performance of algorithms much more accurately than the standard RAM model. The models, however, require specifying algorithms at a very low level requiring the user to carefully lay out their data in arrays in memory and manage their own memory allocation. In this paper we present a cost model for analyzing the memory efficiency of algorithms expressed in a simple functional language. We show how some algorithms written in standard forms using just lists and trees (no arrays) and requiring no explicit memory layout or memory management are efficient in the model. We then describe an implementation of the language and show provable bounds for mapping the cost in our model to the cost in the ideal-cache model. These bound imply that purely functional programs based on lists and trees with no special attention to any details of memory layout can be as asymptotically as efficient as the carefully designed imperative I/O efficient algorithms. For example we describe an O(n_B logM/Bn_B)cost sorting algorithm, which is optimal in the ideal cache and I/O models.

Publisher

Association for Computing Machinery (ACM)

Subject

Computer Graphics and Computer-Aided Design,Software

Reference23 articles.

1. A Functional Approach to External Graph Algorithms

2. The input/output complexity of sorting and related problems

3. Garbage collection can be faster than stack allocation

4. L. Arge M. A. Bender E. D. Demaine C. E. Leiserson and K. Mehlhorn editors . Cache-Oblivious and Cache-Aware Algorithms 18.07. - 23.07.2004 volume 04301 of Dagstuhl Seminar Proceedings 2005 . IBFI Schloss Dagstuhl Germany . L. Arge M. A. Bender E. D. Demaine C. E. Leiserson and K. Mehlhorn editors. Cache-Oblivious and Cache-Aware Algorithms 18.07. - 23.07.2004 volume 04301 of Dagstuhl Seminar Proceedings 2005. IBFI Schloss Dagstuhl Germany.

5. Parallelism in sequential functional languages

Cited by 3 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. ML for ML: Learning Cost Semantics by Experiment;Tools and Algorithms for the Construction and Analysis of Systems;2017

2. Cache efficient functional algorithms;Communications of the ACM;2015-06-25

3. Automatic Static Cost Analysis for Parallel Programs;Programming Languages and Systems;2015

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3