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 » A new container in works: Flex - fast insertion vector
Re: A new container in works: Flex - fast insertion vector [message #11684 is a reply to message #11683] Fri, 21 September 2007 14:30 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
sergei wrote on Fri, 21 September 2007 07:51

When I said sorted containers what I needed is not find/unique (hash could do that too), but to iterate over all elements, from smallest ro largest / reverse. You say operator[] is slow. Would such iteration be slower than in set, or not?



Not actually measured, but iterating through link structures tends to be slow with modern CPUs, so I would say that the linear iteration would be about the same.

That said, it is a bit surprising that you would prefer sorted container only to get items in order. Using Index (or generally a hash_map) and Sorting the result beats this in most cases.

For me, the main advantage of such container would be the lower and upper bounds.

Quote:


I don't know how allocators work, but what have you done to get it faster than default? Some kind of buffering to allocate once for several small elements?



The algorithm of latest U++ allocator is described in the Core/srcimp.tpp.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New FileSel(elector).
Next Topic: GDI, and therefore, Draw performance on Vista
Goto Forum:
  


Current Time: Sun May 19 12:44:19 CEST 2024

Total time taken to generate the page: 0.00966 seconds