Click here to Skip to main content
15,890,932 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to load map of maps Pin
b-rad31126-May-10 7:42
b-rad31126-May-10 7:42 
GeneralRe: how to load map of maps Pin
David Crow26-May-10 8:10
David Crow26-May-10 8:10 
GeneralRe: how to load map of maps Pin
b-rad31126-May-10 11:52
b-rad31126-May-10 11:52 
GeneralRe: how to load map of maps Pin
David Crow26-May-10 17:21
David Crow26-May-10 17:21 
QuestionRe: how to load map of maps Pin
David Crow26-May-10 3:41
David Crow26-May-10 3:41 
AnswerRe: how to load map of maps Pin
b-rad31126-May-10 3:48
b-rad31126-May-10 3:48 
GeneralRe: how to load map of maps Pin
Aescleal26-May-10 4:02
Aescleal26-May-10 4:02 
GeneralRe: how to load map of maps Pin
El Corazon26-May-10 15:39
El Corazon26-May-10 15:39 
b-rad311 wrote:

Thanks for replying. I'm trying to shy away from vector usage because, due to the large amount of data, vector storage and usage (particulary push_back) are killing the efficiency. So I'm trying to experiment with other methods such as map of maps.


maps actually begin to be inefficient at large numbers too. Remember that a map is internally stored as a binary tree in most implementations. This is highly efficient method of searching since it always becomes the equivalent of a quick search through your data to find any one node. However, the depth of the tree begins to slow down all operations as well. As mentioned, if you reserve space on a vector you can achieve high speed. Vector reallocates at 50% above your last block size when it runs out of memory, then shifts the contents over to a new array that is larger. It is the reallocation and move that occupies most of the time of the push_back.

There are also alternatives, depending on what you want to achieve. I use pre-allocated vectors as large hash-tables, with the appropriately speedy hash algorithm you can beat a map on very large data sets. It all comes down to need and desired performance.

so you spoke of a time key, but what are you storing and how do you need to access it?
_________________________
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."

Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

GeneralRe: how to load map of maps [modified] Pin
b-rad31127-May-10 3:39
b-rad31127-May-10 3:39 
GeneralRe: how to load map of maps Pin
El Corazon27-May-10 5:17
El Corazon27-May-10 5:17 
GeneralRe: how to load map of maps Pin
b-rad31127-May-10 5:42
b-rad31127-May-10 5:42 
GeneralRe: how to load map of maps Pin
El Corazon27-May-10 6:33
El Corazon27-May-10 6:33 
GeneralRe: how to load map of maps Pin
El Corazon27-May-10 6:56
El Corazon27-May-10 6:56 
AnswerRe: how to load map of maps Pin
Aescleal26-May-10 3:49
Aescleal26-May-10 3:49 
GeneralRe: how to load map of maps Pin
b-rad31126-May-10 4:23
b-rad31126-May-10 4:23 
QuestionSDK Pin
john563226-May-10 3:08
john563226-May-10 3:08 
AnswerRe: SDK Pin
Richard MacCutchan26-May-10 4:28
mveRichard MacCutchan26-May-10 4:28 
Questionhow to show dynamic values in the clistctrl Pin
manoharbalu26-May-10 1:21
manoharbalu26-May-10 1:21 
AnswerRe: how to show dynamic values in the clistctrl Pin
Code-o-mat26-May-10 1:47
Code-o-mat26-May-10 1:47 
GeneralRe: how to show dynamic values in the clistctrl Pin
manoharbalu26-May-10 2:05
manoharbalu26-May-10 2:05 
GeneralRe: how to show dynamic values in the clistctrl Pin
Code-o-mat26-May-10 2:27
Code-o-mat26-May-10 2:27 
GeneralRe: how to show dynamic values in the clistctrl Pin
manoharbalu26-May-10 3:00
manoharbalu26-May-10 3:00 
GeneralRe: how to show dynamic values in the clistctrl Pin
Code-o-mat26-May-10 3:07
Code-o-mat26-May-10 3:07 
QuestionRe: how to show dynamic values in the clistctrl Pin
David Crow26-May-10 3:08
David Crow26-May-10 3:08 
QuestionCStatic as Text and Float Pin
Anu_Bala26-May-10 0:16
Anu_Bala26-May-10 0:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.