Click here to Skip to main content
15,913,722 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: reserve method of vector Pin
Nemanja Trifunovic15-Nov-07 4:56
Nemanja Trifunovic15-Nov-07 4:56 
GeneralRe: reserve method of vector Pin
George_George15-Nov-07 15:54
George_George15-Nov-07 15:54 
AnswerRe: reserve method of vector Pin
led mike15-Nov-07 4:58
led mike15-Nov-07 4:58 
GeneralRe: reserve method of vector Pin
George_George15-Nov-07 16:07
George_George15-Nov-07 16:07 
GeneralRe: reserve method of vector Pin
led mike16-Nov-07 5:04
led mike16-Nov-07 5:04 
GeneralRe: reserve method of vector Pin
George_George18-Nov-07 1:25
George_George18-Nov-07 1:25 
GeneralRe: reserve method of vector Pin
Matthew Faithfull15-Nov-07 5:07
Matthew Faithfull15-Nov-07 5:07 
GeneralRe: reserve method of vector Pin
George_George15-Nov-07 16:29
George_George15-Nov-07 16:29 
Thanks Matthew,


I do not quite agree with your following scenarios, Smile | :)

Please feel free to correct me if I am wrong?

1. In the following scenario, you mentioned there will be performance improvement,

Matthew Faithfull wrote:
In general if you're working with a larger number of items but only 1 at a time, adding and deleting more or less at random then reserving will give you the greatest performance gain.


Suppose we reserved a large number of memory, but we only do small operation (e.g. adding/deleting one item).
Why will performance be improved? On the contrary, I think the following scenario you mentioned below will improve performance if we reserve a large number of memory in advance. Smile | :)

2. I think in the following scenario, since we reserved a large number of memory in advance, so the performance should be improved. But why you mentioned there will be almost no performance improvements?

Matthew Faithfull wrote:
If you're performing entirely linear operations, add 10,000 items, then iterate over them a few times in order, then free them, it will give you very little or nothing.



regards,
George
QuestionHttp Request Pin
San246815-Nov-07 4:28
San246815-Nov-07 4:28 
AnswerRe: Http Request Pin
led mike15-Nov-07 4:54
led mike15-Nov-07 4:54 
GeneralRe: Http Request Pin
San246815-Nov-07 5:10
San246815-Nov-07 5:10 
GeneralRe: Http Request Pin
led mike15-Nov-07 5:25
led mike15-Nov-07 5:25 
Questionchanging the cursor postion in a editable combobox??? Pin
SnaKeBeD15-Nov-07 3:39
SnaKeBeD15-Nov-07 3:39 
AnswerRe: changing the cursor postion in a editable combobox??? Pin
DoomedOne15-Nov-07 5:34
DoomedOne15-Nov-07 5:34 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
Deepu Antony15-Nov-07 7:45
Deepu Antony15-Nov-07 7:45 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
SnaKeBeD15-Nov-07 7:49
SnaKeBeD15-Nov-07 7:49 
QuestionRe: changing the cursor postion in a editable combobox??? Pin
David Crow15-Nov-07 8:42
David Crow15-Nov-07 8:42 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
DoomedOne15-Nov-07 9:45
DoomedOne15-Nov-07 9:45 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
chandu00415-Nov-07 21:05
chandu00415-Nov-07 21:05 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
Nelek15-Nov-07 23:46
protectorNelek15-Nov-07 23:46 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
chandu00416-Nov-07 20:55
chandu00416-Nov-07 20:55 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
Nelek19-Nov-07 21:39
protectorNelek19-Nov-07 21:39 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
SnaKeBeD16-Nov-07 4:33
SnaKeBeD16-Nov-07 4:33 
GeneralRe: changing the cursor postion in a editable combobox??? Pin
DoomedOne16-Nov-07 6:53
DoomedOne16-Nov-07 6:53 
QuestionHow can block a Messenger packet....? Pin
jomons15-Nov-07 2:24
jomons15-Nov-07 2:24 

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.