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++ Developers corner » Funny way how NOT to speedup sorting of small arrays
Re: Funny way how NOT to speedup sorting of small arrays [message #22955 is a reply to message #22937] Wed, 02 September 2009 17:42 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
piotr5 wrote on Sun, 30 August 2009 19:38


insert-sort in combination with binary search and a mem-copy for the insertion is faster (with my particular test-data) than any of them. it isn't much, but it's noticable. unfortunately memcpy() isn't fair since it doesn't take care of any pick-beaurocracy -- but it certainly is faster than any piece-by-piece swapping or shifting.



Well, but it IS compatible with Moveable.

Actually, this is an interesting point w.r.t. to moving some of algorithms to containers. Obviously, if Sort would be Vector's method, it would be OK for it to use memmove...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 1538 compilation fails
Next Topic: German language added to Docking.t of bazar/Docking
Goto Forum:
  


Current Time: Sun Apr 27 22:19:56 CEST 2025

Total time taken to generate the page: 0.01017 seconds