Click here to Skip to main content
15,921,577 members
Home / Discussions / C#
   

C#

 
GeneralRe: Performance difference?? Pin
Shy Agam27-Jul-07 10:13
Shy Agam27-Jul-07 10:13 
AnswerRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 10:06
sitebuilderLuc Pattyn27-Jul-07 10:06 
GeneralRe: Performance difference?? Pin
BoneSoft27-Jul-07 10:29
BoneSoft27-Jul-07 10:29 
GeneralRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 10:46
sitebuilderLuc Pattyn27-Jul-07 10:46 
AnswerRe: Performance difference?? Pin
Paul Conrad27-Jul-07 10:07
professionalPaul Conrad27-Jul-07 10:07 
AnswerRe: Performance difference?? Pin
snorkie27-Jul-07 10:51
professionalsnorkie27-Jul-07 10:51 
GeneralRe: Performance difference?? Pin
PIEBALDconsult27-Jul-07 13:38
mvePIEBALDconsult27-Jul-07 13:38 
GeneralRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 14:57
sitebuilderLuc Pattyn27-Jul-07 14:57 
So the measured difference is less than 1% which is I guess well below
your measurement accuracy: you are measuring elapsed time (good) over
a long period (50 sec, good), but circumstances vary: there are hundreds
of threads in an idle system, watching each and every part of your machine,
there are disk transfers with DMA, there is a varying amount of Ethernet
traffic including broadcast messages you are not interested in, etc etc.

So my first impression is the execution times are the same.

What you could do is reduce the loop count by a factor of 100, run it
100 times, and observe the distribution of the 100 timing results.

The disappointment is neither the C# compiler nor the JIT compiler was
smart enough to recognize the entire loop body could and should be moved
outside, and then the loop is without subject; so it should have been
hundred ticks at most !

On a non-CLR language (such as good old C) it takes quite some tricks
to prevent the compiler from throwing it all out, and still get an
accurate measurement !

Smile | :)






AnswerMessage formatting question (expires on sunday) Pin
Luc Pattyn27-Jul-07 23:36
sitebuilderLuc Pattyn27-Jul-07 23:36 
GeneralRe: Message formatting question (expires on sunday) Pin
Shy Agam28-Jul-07 1:41
Shy Agam28-Jul-07 1:41 
GeneralRe: Message formatting question (expires on sunday) Pin
Luc Pattyn28-Jul-07 2:18
sitebuilderLuc Pattyn28-Jul-07 2:18 
QuestionHow to use C++ file ( header ) in C# project ? Pin
Yanshof27-Jul-07 8:35
Yanshof27-Jul-07 8:35 
AnswerRe: How to use C++ file ( header ) in C# project ? Pin
Judah Gabriel Himango27-Jul-07 9:21
sponsorJudah Gabriel Himango27-Jul-07 9:21 
GeneralRe: How to use C++ file ( header ) in C# project ? Pin
Yanshof27-Jul-07 10:37
Yanshof27-Jul-07 10:37 
GeneralRe: How to use C++ file ( header ) in C# project ? Pin
Judah Gabriel Himango27-Jul-07 10:55
sponsorJudah Gabriel Himango27-Jul-07 10:55 
Questionboolean variable as null Pin
ltmnm27-Jul-07 7:58
ltmnm27-Jul-07 7:58 
AnswerRe: boolean variable as null Pin
Justin Perez27-Jul-07 8:17
Justin Perez27-Jul-07 8:17 
GeneralRe: boolean variable as null Pin
Colin Angus Mackay27-Jul-07 22:52
Colin Angus Mackay27-Jul-07 22:52 
AnswerRe: boolean variable as null Pin
Abisodun27-Jul-07 8:19
Abisodun27-Jul-07 8:19 
GeneralRe: boolean variable as null Pin
Justin Perez27-Jul-07 8:21
Justin Perez27-Jul-07 8:21 
AnswerRe: boolean variable as null Pin
Paul Conrad27-Jul-07 8:22
professionalPaul Conrad27-Jul-07 8:22 
GeneralRe: boolean variable as null Pin
PhilDanger27-Jul-07 8:37
PhilDanger27-Jul-07 8:37 
GeneralRe: boolean variable as null Pin
Paul Conrad27-Jul-07 8:40
professionalPaul Conrad27-Jul-07 8:40 
GeneralRe: boolean variable as null Pin
BoneSoft27-Jul-07 9:48
BoneSoft27-Jul-07 9:48 
GeneralRe: boolean variable as null Pin
ltmnm27-Jul-07 8:37
ltmnm27-Jul-07 8: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.