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 next 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
Re: StableSort revisited... [message #15237 is a reply to message #15234] Fri, 11 April 2008 09:36 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
These optimizations are going into 2008.1 too?
Re: StableSort revisited... [message #15240 is a reply to message #15237] Fri, 11 April 2008 13:41 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes.

(And yes, I agree it is wrong Wink

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


Current Time: Thu Mar 28 13:19:50 CET 2024

Total time taken to generate the page: 0.01022 seconds