Click here to Skip to main content
16,005,552 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: GDI+ damned slow ??? Pin
Christian Graus20-Jun-05 15:35
protectorChristian Graus20-Jun-05 15:35 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd20-Jun-05 16:08
l3st4rd20-Jun-05 16:08 
GeneralRe: GDI+ damned slow ??? Pin
Christian Graus20-Jun-05 16:14
protectorChristian Graus20-Jun-05 16:14 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd20-Jun-05 16:21
l3st4rd20-Jun-05 16:21 
GeneralRe: GDI+ damned slow ??? Pin
Robert Rohde21-Jun-05 0:45
Robert Rohde21-Jun-05 0:45 
GeneralRe: GDI+ damned slow ??? Pin
Christian Graus21-Jun-05 12:59
protectorChristian Graus21-Jun-05 12:59 
GeneralRe: GDI+ damned slow ??? Pin
Robert Rohde21-Jun-05 20:02
Robert Rohde21-Jun-05 20:02 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd21-Jun-05 15:51
l3st4rd21-Jun-05 15:51 
ok, i heard that often before. nearly everybody tells me c# isnt (much) slower. but WHY is it really a lot slower when i check this myself?

as i really wanted to know now, i tried it myself (and feel free to do so, too) and took both (c++ of VS 6.0 and c# of VS.Net 2003) and let them calculate fibonacci numbers up to n=40.
MY results are:
VS6.0 & c++: 2.580 seconds
VS.Net 2003 & c#: 5.019 seconds
(results should be accurate down to less than 1 msec)

so why does c# require almost 2 times the time c++ does?
PLEASE check this yourself, let me know if i'm right and also tell me if i'm not correct...
i'd really like to know the truth and not just rely on some weird microsoft benchmarks.

both tests were build in "Release" configuration, without debug information and with code
optimization a.s.o.
the code was (both times called in first constructor and immediatly after each other, so u can't say it depends on any other circumstances like free RAM or things like that....)

c#:

private long fib(long n)
{
if (n < 2)
return n;
return fib(n-1) + fib(n-2);
}

c++:

long fib(long n) {
if (n < 2)
return n;
return fib(n-1) + fib(n-2);
}

both times the result was 102334155. so what am i doing wrong? why is c# so much slower for me than c++? just because of the excessive recursion and stack usage? should i try an example concerning
"only" function calls or memory access? or check the speed of _dynamic_ array operations?

second thing i don't understand is (and thx for the hint; i really need any solution and thus try this): you're saying c# and calling GDI+ APIs directly is as fast as c++; ok, but the GDI+ code remains the same wheather u call it directly or not. so if it's not GDI+ it has to be c# (what else?)... so isn't this in conflict with your first statement???

this should really be no offense, i only wanna know for sure how things are...

daniel.
GeneralRe: GDI+ damned slow ??? Pin
Christian Graus21-Jun-05 16:25
protectorChristian Graus21-Jun-05 16:25 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd21-Jun-05 17:07
l3st4rd21-Jun-05 17:07 
GeneralRe: GDI+ damned slow ??? Pin
Christian Graus21-Jun-05 17:13
protectorChristian Graus21-Jun-05 17:13 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd21-Jun-05 17:45
l3st4rd21-Jun-05 17:45 
GeneralRe: GDI+ damned slow ??? Pin
Christian Graus21-Jun-05 17:47
protectorChristian Graus21-Jun-05 17:47 
GeneralRe: GDI+ damned slow ??? Pin
Robert Rohde21-Jun-05 20:07
Robert Rohde21-Jun-05 20:07 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd22-Jun-05 6:45
l3st4rd22-Jun-05 6:45 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd21-Jun-05 14:30
l3st4rd21-Jun-05 14:30 
GeneralRe: GDI+ damned slow ??? Pin
Christian Graus21-Jun-05 14:32
protectorChristian Graus21-Jun-05 14:32 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd21-Jun-05 16:08
l3st4rd21-Jun-05 16:08 
GeneralRe: GDI+ damned slow ??? Pin
Christian Graus21-Jun-05 16:29
protectorChristian Graus21-Jun-05 16:29 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd21-Jun-05 16:44
l3st4rd21-Jun-05 16:44 
GeneralRe: GDI+ damned slow ??? Pin
Christian Graus21-Jun-05 16:47
protectorChristian Graus21-Jun-05 16:47 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd21-Jun-05 17:25
l3st4rd21-Jun-05 17:25 
GeneralRe: GDI+ damned slow ??? Pin
Christian Graus21-Jun-05 17:27
protectorChristian Graus21-Jun-05 17:27 
GeneralRe: GDI+ damned slow ??? Pin
l3st4rd21-Jun-05 16:46
l3st4rd21-Jun-05 16:46 
AnswerRe: GDI+ damned slow ??? Pin
gr1p21-Jun-05 16:13
sussgr1p21-Jun-05 16:13 

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.