Click here to Skip to main content
15,889,116 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: On hold... Pin
Dave Kreskowiak20-Mar-06 10:11
mveDave Kreskowiak20-Mar-06 10:11 
GeneralRe: On hold... Pin
Jam.X20-Mar-06 13:36
Jam.X20-Mar-06 13:36 
QuestionInserting Page Break Pin
User 246299120-Mar-06 3:04
professionalUser 246299120-Mar-06 3:04 
AnswerRe: Inserting Page Break Pin
Robert Rohde20-Mar-06 7:20
Robert Rohde20-Mar-06 7:20 
GeneralRe: Inserting Page Break Pin
User 246299120-Mar-06 17:12
professionalUser 246299120-Mar-06 17:12 
QuestionAutoCad Tool Palette with .Net Pin
prakashdotc20-Mar-06 2:26
prakashdotc20-Mar-06 2:26 
QuestionIList vs array performance observation (.NET 2.0) Pin
wout de zeeuw19-Mar-06 22:52
wout de zeeuw19-Mar-06 22:52 
AnswerRe: IList vs array performance observation (.NET 2.0) Pin
ricardojb20-Mar-06 9:29
ricardojb20-Mar-06 9:29 
Of course there will be a performance penalty for using a collection over an array. Even though with generics you can easily implement strongy typed collections (avoiding casting and boxing unboxing), the collections in fact use arrays. They provide you with more flexibility than an array (like you don't need to know the number of elements and they can grow as needed) but basically what it does is array operations.

There are some ways you can improve performance, if you know the number of items you can setup the MaximumLenght property of your collection.

Also, both with arrays and collections, whenever you try to access a member, the CLR will perform a bound check.

but if you access it in a for loop, where you expressely use the .Count, or .Lenght property, the compiler is smart enough to detect that and won't do bound checks with a considerable performance gain (in long running loops).

for example

suppose you have an array a and you want to iteract.

you can do it like this:

int limit = a.Lenght;

for (int i = 0; i < limit; i++)
{
}

this will do a bound check for each iteraction.

if you do

for (int i=0; i < a.Lenght; i++)
{
}

this boundcheck will not be performed.
GeneralRe: IList vs array performance observation (.NET 2.0) Pin
wout de zeeuw20-Mar-06 10:11
wout de zeeuw20-Mar-06 10:11 
GeneralRe: IList vs array performance observation (.NET 2.0) Pin
Ed.Poore24-Mar-06 8:01
Ed.Poore24-Mar-06 8:01 
GeneralRe: IList vs array performance observation (.NET 2.0) Pin
wout de zeeuw24-Mar-06 9:15
wout de zeeuw24-Mar-06 9:15 
GeneralRe: IList vs array performance observation (.NET 2.0) Pin
Ed.Poore24-Mar-06 10:57
Ed.Poore24-Mar-06 10:57 
QuestionIs this possible? Pin
Xaake19-Mar-06 10:48
Xaake19-Mar-06 10:48 
AnswerRe: Is this possible? Pin
Dave Kreskowiak19-Mar-06 12:36
mveDave Kreskowiak19-Mar-06 12:36 
GeneralRe: Is this possible? Pin
Xaake19-Mar-06 23:02
Xaake19-Mar-06 23:02 
QuestionExecuting code remotely Pin
Imtiaz Murtaza18-Mar-06 6:51
Imtiaz Murtaza18-Mar-06 6:51 
QuestionTransaction state in 3-tier architecture Pin
Sheshadrinath17-Mar-06 23:05
Sheshadrinath17-Mar-06 23:05 
AnswerRe: Transaction state in 3-tier architecture Pin
Guffa18-Mar-06 2:27
Guffa18-Mar-06 2:27 
QuestionReplace system tray clock Pin
bowlermonk17-Mar-06 7:33
bowlermonk17-Mar-06 7:33 
AnswerRe: Replace system tray clock Pin
Dave Kreskowiak17-Mar-06 9:20
mveDave Kreskowiak17-Mar-06 9:20 
GeneralRe: Replace system tray clock Pin
bowlermonk17-Mar-06 10:43
bowlermonk17-Mar-06 10:43 
GeneralRe: Replace system tray clock Pin
Dave Kreskowiak17-Mar-06 16:25
mveDave Kreskowiak17-Mar-06 16:25 
QuestionProblem getting thread to work Pin
rsw117-Mar-06 6:57
rsw117-Mar-06 6:57 
QuestionTextBox Control Pin
John L. DeVito17-Mar-06 6:17
professionalJohn L. DeVito17-Mar-06 6:17 
AnswerRe: TextBox Control Pin
Guffa17-Mar-06 6:37
Guffa17-Mar-06 6:37 

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.