Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » StableSort revisited...
StableSort revisited... [message #15234] Fri, 11 April 2008 05:25 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Stable sort was reimplemented; merge-sort implementation was replaced by adaptor to standard Sort.

This has two advantages:

- Only IterSwap and comparison is now required for StableSort, this means better performance for Array and also possibility to sort polymorphic arrays

- Instead of temporary buffer of sizeof(T) * count, only sizeof(int) * count is now required.

Perfomance for average case is better than original U++ mergesort and on par with stl's mergesort.

Anyway, as for this kind stable sort C-style sign compare ("SgnCompare" in U++) is a bit faster, there are also introduced version ending "Cmp" that rely on this 3-state comparison predicate instead.

Mirek
 
Read Message
Read Message
Read Message
Previous Topic: Stream feature drop and optimization
Next Topic: Index, VectorMap, ArrayIndex and ArrayMap :: Remove(int i, count)
Goto Forum:
  


Current Time: Thu Apr 25 01:59:57 CEST 2024

Total time taken to generate the page: 0.03703 seconds