ARL, a faster in-place, cache friendly sorting algorithm

نویسنده

  • Arne Maus
چکیده

This paper introduces a new, faster sorting algorithm (ARL – Adaptive Left Radix) that does in-place, non-stable sorting. Left Radix, often called MSD (Most Significant Digit) radix, is not new in itself, but the adaptive feature and the in-place sorting ability are new features. ARL does sorting with only internal moves in the array, and uses a dynamically defined radix for each pass. ALR is a recursive algorithm that sorts by first sorting on the most significant ‘digits’ of the numbers – i.e. going from left to right. Its space requirements are O(N + logM) and time performance is O(N*log M) – where M is the maximum value sorted and N is the number of integers to sort. The performance of ARL is compared with both with the built in Quicksort algorithm in Java, Arrays.sort(), and with ordinary Radix sorting (sorting from right-to-left). ARL is almost twice as fast as Quicksort if N > 100. This applies to the normal case, a uniformly drawn distribution of the numbers 0:N-1. ARL is also in significantly faster than Quicksort for 8 out of 9 other investigated distributions of the numbers to be sorted. ARL is more cache friendly than Quicksort and also maybe ordinary Radix by generating fewer cache misses. Even though Radix is faster in most cases, ARL becomes faster than Radix for large n (n > 5* 10). Since the space requirement for Radix is twice that of ARL (and Quicksort), this paper proposes ARL as a better general sorting algorithm than Quicksort.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Efficient Adaptive In-Place Radix Sorting

This paper presents a new in-place pseudo linear radix sorting algorithm. The proposed algorithm, called MSL (Map Shuffle Loop) is an improvement over ARL (Maus, 2002). The ARL algorithm uses an in-place permutation loop of linear complexity in terms of input size. MSL uses a faster permutation loop searching for the next element to permute group by group, instead of element by element. The alg...

متن کامل

A full parallel radix sorting algorithm for multicore processors

The problem addressed in this paper is that we want to sort an integer array a [] of length n on a multi core machine with k cores. Amdahl’s law tells us that the inherent sequential part of any algorithm will in the end dominate and limit the speedup we get from parallelisation of that algorithm. This paper introduces PARL, a parallel left radix sorting algorithm for use on ordinary shared mem...

متن کامل

Cache Analysis of Non-uniform Distribution Sorting Algorithms

We analyse the average-case cache performance of distribution sorting algorithms in the case when keys are independently but not necessarily uniformly distributed. The analysis is for both ‘in-place’ and ‘out-of-place’ distribution sorting algorithms and is more accurate than the analysis presented in [13]. In particular, this new analysis yields tighter upper and lower bounds when the keys are...

متن کامل

SIMD- and Cache-Friendly Algorithm for Sorting an Array of Structures

This paper describes our new algorithm for sorting an array of structures by efficiently exploiting the SIMD instructions and cache memory of today’s processors. Recently, multiway mergesort implemented with SIMD instructions has been used as a high-performance in-memory sorting algorithm for sorting integer values. For sorting an array of structures with SIMD instructions, a frequently used ap...

متن کامل

Reduction in Cache Memory Power Consumption based on Replacement Quantity

Today power consumption is considered to be one of the important issues. Therefore, its reduction plays a considerable role in developing systems. Previous studies have shown that approximately 50% of total power consumption is used in cache memories. There is a direct relationship between power consumption and replacement quantity made in cache. The less the number of replacements is, the less...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003