Branch Mispredictions Don’t Affect Mergesort

合并排序 快速排序 计算机科学 并行计算 算法 分类 排序算法
作者
Amr Elmasry,Jyrki Katajainen,Max Stenmark
出处
期刊:Lecture Notes in Computer Science 卷期号:: 160-171 被引量:12
标识
DOI:10.1007/978-3-642-30850-5_15
摘要

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 log2 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(log2 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.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
更新
大幅提高文件上传限制,最高150M (2024-4-1)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
junjiehu完成签到,获得积分20
4秒前
Akim应助Yw_M采纳,获得10
13秒前
future完成签到 ,获得积分10
13秒前
Wxj246801发布了新的文献求助10
14秒前
15秒前
酷波er应助奶油大卡采纳,获得10
15秒前
16秒前
结实的忆秋完成签到 ,获得积分10
16秒前
寻道图强应助奋斗的绝悟采纳,获得20
16秒前
weiweiwu12发布了新的文献求助10
17秒前
黄飚完成签到,获得积分10
21秒前
百里博涛完成签到 ,获得积分10
22秒前
22秒前
爱鱼人士应助Dawn采纳,获得30
23秒前
23秒前
24秒前
打打应助jangkeunsuk采纳,获得10
24秒前
秋雪瑶应助研友_Ze0vBn采纳,获得10
25秒前
28秒前
大个应助激光炮砰砰砰采纳,获得10
28秒前
汉堡包应助激光炮砰砰砰采纳,获得10
28秒前
活力文轩发布了新的文献求助10
28秒前
奶油大卡发布了新的文献求助10
28秒前
小美完成签到,获得积分10
31秒前
张馨元完成签到,获得积分10
32秒前
34秒前
34秒前
木木酱完成签到,获得积分10
36秒前
36秒前
37秒前
东君完成签到 ,获得积分10
38秒前
40秒前
小美发布了新的文献求助10
40秒前
shang发布了新的文献求助10
41秒前
ark861023发布了新的文献求助10
41秒前
JINWEIJIANG发布了新的文献求助10
42秒前
萝卜发布了新的文献求助10
43秒前
活力文轩完成签到 ,获得积分20
46秒前
pp发布了新的文献求助10
47秒前
weiweiwu12发布了新的文献求助10
52秒前
高分求助中
The three stars each: the Astrolabes and related texts 1100
Sport in der Antike 800
De arte gymnastica. The art of gymnastics 600
Berns Ziesemer - Maos deutscher Topagent: Wie China die Bundesrepublik eroberte 500
Stephen R. Mackinnon - Chen Hansheng: China’s Last Romantic Revolutionary (2023) 500
Sport in der Antike Hardcover – March 1, 2015 500
Psychological Warfare Operations at Lower Echelons in the Eighth Army, July 1952 – July 1953 400
热门求助领域 (近24小时)
化学 材料科学 医学 生物 有机化学 工程类 生物化学 纳米技术 物理 内科学 计算机科学 化学工程 复合材料 遗传学 基因 物理化学 催化作用 电极 光电子学 量子力学
热门帖子
关注 科研通微信公众号,转发送积分 2426952
求助须知:如何正确求助?哪些是违规求助? 2113336
关于积分的说明 5354977
捐赠科研通 1841239
什么是DOI,文献DOI怎么找? 916230
版权声明 561421
科研通“疑难数据库(出版商)”最低求助积分说明 490098