Click here to Skip to main content
15,889,909 members
Home / Discussions / C#
   

C#

 
GeneralRe: A Question Of Efficiency Pin
Roger Wright15-Nov-10 18:15
professionalRoger Wright15-Nov-10 18:15 
GeneralRe: A Question Of Efficiency Pin
Luc Pattyn16-Nov-10 2:27
sitebuilderLuc Pattyn16-Nov-10 2:27 
AnswerRe: A Question Of Efficiency Pin
_Erik_16-Nov-10 1:58
_Erik_16-Nov-10 1:58 
GeneralRe: A Question Of Efficiency Pin
Roger Wright17-Nov-10 14:14
professionalRoger Wright17-Nov-10 14:14 
AnswerRe: A Question Of Efficiency Pin
PIEBALDconsult16-Nov-10 2:17
mvePIEBALDconsult16-Nov-10 2:17 
GeneralRe: A Question Of Efficiency Pin
Roger Wright17-Nov-10 14:11
professionalRoger Wright17-Nov-10 14:11 
GeneralRe: A Question Of Efficiency Pin
PIEBALDconsult18-Nov-10 2:14
mvePIEBALDconsult18-Nov-10 2:14 
AnswerRe: A Question Of Efficiency Pin
RobCroll17-Nov-10 4:12
RobCroll17-Nov-10 4:12 
One way of improving performance when dealing with collections is by setting the capacity of the list when initialising the list. If you know the size of the list when instantiating the class, use the overloaded constructor (int capacity).

The reason for doing this is that under the hood, lists are just arrays. I can't remember what the default capacity is but lets say the underlying array has a capacity of 100,000, when you add the 100,001 item, the list will re-dimension to 200,000. Basically it doubles in size each time it re-dimensions. Re-dimensioning the array exponentially is expensive, if you know the capacity in advance, you are going to maximise performance.
GeneralRe: A Question Of Efficiency Pin
Roger Wright17-Nov-10 14:10
professionalRoger Wright17-Nov-10 14:10 
QuestionContrast problem Pin
pancakeleh15-Nov-10 16:57
pancakeleh15-Nov-10 16:57 
AnswerRe: Contrast problem Pin
Roger Wright15-Nov-10 17:14
professionalRoger Wright15-Nov-10 17:14 
GeneralRe: Contrast problem Pin
pancakeleh15-Nov-10 17:22
pancakeleh15-Nov-10 17:22 
GeneralRe: Contrast problem Pin
Dr.Walt Fair, PE15-Nov-10 18:03
professionalDr.Walt Fair, PE15-Nov-10 18:03 
GeneralRe: Contrast problem Pin
Roger Wright15-Nov-10 18:24
professionalRoger Wright15-Nov-10 18:24 
AnswerRe: Contrast problem Pin
pancakeleh15-Nov-10 19:05
pancakeleh15-Nov-10 19:05 
GeneralRe: Contrast problem Pin
pancakeleh15-Nov-10 21:34
pancakeleh15-Nov-10 21:34 
GeneralRe: Contrast problem Pin
Caslen16-Nov-10 2:46
Caslen16-Nov-10 2:46 
GeneralRe: Contrast problem Pin
pancakeleh16-Nov-10 3:53
pancakeleh16-Nov-10 3:53 
Questionhistogram control Pin
pancakeleh15-Nov-10 16:44
pancakeleh15-Nov-10 16:44 
AnswerRe: histogram control Pin
Dr.Walt Fair, PE15-Nov-10 17:39
professionalDr.Walt Fair, PE15-Nov-10 17:39 
QuestionAsync vs Sync Pin
Jacob D Dixon15-Nov-10 14:03
Jacob D Dixon15-Nov-10 14:03 
AnswerRe: Async vs Sync Pin
Luc Pattyn15-Nov-10 14:54
sitebuilderLuc Pattyn15-Nov-10 14:54 
GeneralRe: Async vs Sync Pin
Jacob D Dixon15-Nov-10 17:21
Jacob D Dixon15-Nov-10 17:21 
AnswerRe: Async vs Sync Pin
Luc Pattyn15-Nov-10 17:31
sitebuilderLuc Pattyn15-Nov-10 17:31 
GeneralRe: Async vs Sync Pin
Jacob D Dixon16-Nov-10 13:54
Jacob D Dixon16-Nov-10 13:54 

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.