Has anybody merged runs from both ends ?
...
Merge sort is traditionally done from one end (usually the low one) to the other. But what can prevent us from doing it from both ends ?
The code is longer, sure, but modern OOOx processors have incredibly large windows of execution with more than a hundred instructions "in flight" at the same time so managing both ends at the same time would help "parallelise" the execution and the only time both ends must re-sync is when they reach the middle of the output buffer.
Instant 2x speedup with little algorithmic change, who could refuse ?
.
.
.
Edit:
OK I see a situation where this would create problems : with runs of equal data so this is a special case to take into account.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.