Click here to Skip to main content
15,914,419 members
Home / Discussions / C#
   

C#

 
QuestionSpeed of execution Pin
Kevin1316-Sep-11 5:10
Kevin1316-Sep-11 5:10 
AnswerRe: Speed of execution Pin
Simon Bang Terkildsen16-Sep-11 5:54
Simon Bang Terkildsen16-Sep-11 5:54 
GeneralRe: Speed of execution Pin
Kevin1316-Sep-11 6:43
Kevin1316-Sep-11 6:43 
AnswerRe: Speed of execution Pin
Matt Meyer16-Sep-11 6:11
Matt Meyer16-Sep-11 6:11 
GeneralRe: Speed of execution Pin
Kevin1316-Sep-11 6:34
Kevin1316-Sep-11 6:34 
GeneralRe: Speed of execution Pin
Matt Meyer16-Sep-11 7:02
Matt Meyer16-Sep-11 7:02 
AnswerRe: Speed of execution Pin
AspDotNetDev16-Sep-11 7:02
protectorAspDotNetDev16-Sep-11 7:02 
AnswerRe: Speed of execution Pin
Luc Pattyn16-Sep-11 7:18
sitebuilderLuc Pattyn16-Sep-11 7:18 
Are you sure you want a big array filled with a single constant? if not, I urge you to investigate (and ask questions about) the actual things you want, not some mock-up. If you need a predictable content, Array.Copy would be a prime candidate (fill a smaller array first, then copy it as often as you like).

FWIW: No matter what language you use, bigger array elements (int or long) would get copied faster than smaller ones (byte) as the loop count, and the cost of the loop overhead, would decrease.

Finally, as a general comment on performance measurements, anyone proficient in language A and new to language B can easily "proof" that A is faster than B, no matter what A and B are. Half of your C# snippet can be scrapped without affecting the results (and possibly the performance either); however automatic optimizations (which exist both in the compiler and the JIT-compiler) work best when there isn't too much ballast to begin with.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

AnswerRe: Speed of execution Pin
Eddy Vluggen16-Sep-11 9:51
professionalEddy Vluggen16-Sep-11 9:51 
GeneralRe: Speed of execution Pin
AspDotNetDev16-Sep-11 10:38
protectorAspDotNetDev16-Sep-11 10:38 
AnswerRe: Speed of execution Pin
Eddy Vluggen16-Sep-11 11:03
professionalEddy Vluggen16-Sep-11 11:03 
GeneralRe: Speed of execution Pin
AspDotNetDev16-Sep-11 11:20
protectorAspDotNetDev16-Sep-11 11:20 
AnswerRe: Speed of execution Pin
Eddy Vluggen16-Sep-11 11:33
professionalEddy Vluggen16-Sep-11 11:33 
NewsRe: Speed of execution Pin
Eddy Vluggen16-Sep-11 13:44
professionalEddy Vluggen16-Sep-11 13:44 
QuestionUndo functionality for Node rename in TreeView Pin
Nyanoba16-Sep-11 1:28
Nyanoba16-Sep-11 1:28 
AnswerRe: Undo functionality for Node rename in TreeView Pin
BillWoodruff16-Sep-11 2:26
professionalBillWoodruff16-Sep-11 2:26 
AnswerRe: Undo functionality for Node rename in TreeView Pin
BobJanova16-Sep-11 3:51
BobJanova16-Sep-11 3:51 
GeneralRe: Undo functionality for Node rename in TreeView Pin
BillWoodruff16-Sep-11 17:01
professionalBillWoodruff16-Sep-11 17:01 
GeneralRe: Undo functionality for Node rename in TreeView Pin
Nyanoba19-Sep-11 19:22
Nyanoba19-Sep-11 19:22 
QuestionShow a hidden console again? Pin
Don Rolando15-Sep-11 22:49
Don Rolando15-Sep-11 22:49 
AnswerRe: Show a hidden console again? Pin
V.15-Sep-11 23:16
professionalV.15-Sep-11 23:16 
GeneralRe: Show a hidden console again? Pin
Don Rolando15-Sep-11 23:18
Don Rolando15-Sep-11 23:18 
GeneralRe: Show a hidden console again? Pin
V.15-Sep-11 23:37
professionalV.15-Sep-11 23:37 
GeneralRe: Show a hidden console again? Pin
Don Rolando16-Sep-11 0:23
Don Rolando16-Sep-11 0:23 
GeneralRe: Show a hidden console again? Pin
V.16-Sep-11 0:36
professionalV.16-Sep-11 0:36 

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.