首页> 外文会议>Experimental algorithms. >Branch Mispredictions Don't Affect Mergesort
【24h】

Branch Mispredictions Don't Affect Mergesort

机译:分支错误预测不会影响合并排序

获取原文
获取原文并翻译 | 示例

摘要

In quicksort, due to branch mispredictions, a skewed pivot-selection strategy can lead to a better performance than the exact-median pivot-selection strategy, even if the exact median is given for free. In this paper we investigate the effect of branch mispredictions on the behaviour of mergesort. By decoupling element comparisons from branches, we can avoid most negative effects caused by branch mispredictions. When sorting a sequence of n elements, our fastest version of mergesort performs n log_2 n + O(n) element comparisons and induces at most O(n) branch mispredictions. We also describe an in-situ version of mergesort that provides the same bounds, but uses only O(log_2 n) words of extra memory. In our test computers, when sorting integer data, mergesort was the fastest sorting method, then came quicksort, and in-situ mergesort was the slowest of the three. We did a similar kind of decoupling for quicksort, but the transformation made it slower.
机译:在快速排序中,由于分支的错误预测,即使精确的中位数是免费提供的,偏斜的枢轴选择策略也可以导致比精确中值枢轴选择策略更好的性能。在本文中,我们研究了分支错误预测对mergesort行为的影响。通过将元素比较与分支分离,我们可以避免由分支预测错误引起的大多数负面影响。当对n个元素的序列进行排序时,我们最快的mergesort版本会执行n个log_2 n + O(n)个元素比较,并最多引起O(n)个分支错误预测。我们还描述了合并排序的原位版本,该版本提供了相同的界限,但仅使用额外内存的O(log_2 n)个字。在我们的测试计算机中,对整数数据进行排序时,mergesort是最快的排序方法,然后是快速排序,而原位归并排序是这三种方法中最慢的。我们对快速排序进行了类似的解耦,但是转换使其速度变慢。

著录项

  • 来源
    《Experimental algorithms.》|2012年|p.160-171|共12页
  • 会议地点 Bordeaux(FR);Bordeaux(FR)
  • 作者单位

    Department of Computer Science, University of Copenhagen, Universitetsparken 1, 2100 Copenhagen East, Denmark;

    Department of Computer Science, University of Copenhagen, Universitetsparken 1, 2100 Copenhagen East, Denmark,Jyrki Katajainen and Company, Thorsgade 101, 2200 Copenhagen North, Denmark;

    Jyrki Katajainen and Company, Thorsgade 101, 2200 Copenhagen North, Denmark;

  • 会议组织
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类 软件工程;软件工程;
  • 关键词

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号