|
Home > Archive > microsoft.public.cert.exam.mcsd > January 2004 > C# or VB.NET - not exaclty the same performance
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
C# or VB.NET - not exaclty the same performance
|
|
|
|
| Jens Andersen 2004-01-20, 1:24 pm |
| On Tue, 20 Jan 2004 09:56:32 -0600, "Daniel P."
<danutzp1@hotmail.comU> wrote:
>MS or anyone still claims that C# and VB.NET generate the exact same IL code
>?
>
>http://www.osnews.com/story.php?news_id=5602&page=3
>
>
Hi
Interestingly enough there is a difference in code for vb and C# that
he used for the IO test.
with his code I got:
I/O elapsed time: 46497 ms with a max of 1000000
i: 1000000
readLine:
abcdefghijklmnopqrstuvwxyz1234
567890abcefghijklmnopqrstuvwxy
z12345678
90abcdefgh
With a few changes to the IO function[1], the result is this:
I/O elapsed time: 9404 ms with a max of 1000000
i: 1000000
readLine:
abcdefghijklmnopqrstuvwxyz1234
567890abcefghijklmnopqrstuvwxy
z12345678
90abcdefgh
The problem is that he is using old vb6 (And below) functions which
are much slower.
Since the IO test was the main difference between VB.Net and C#, there
doesn't seem to be any difference anymore.
Regards,
Jens Andersen
[1]
Dim strWriter As New IO.StreamWriter(fileName)
Do While (i < ioMax)
strWriter.WriteLine(myString)
i += 1
Loop
strWriter.Close()
Dim strReader As New IO.StreamReader(fileName)
i = 0
Do While (i < ioMax)
readLine = strReader.ReadLine()
i += 1
Loop
strReader.Close()
| |
| Hermit Dave 2004-01-20, 6:23 pm |
| plus if a remember my first seminar on .net... at the point where beta 2 was
released... ms only claimed that the msil generated will the equivalent.
if you look at language comformance across different languages... it does
vary...
--
Regards,
HD
Once a Geek.... Always a Geek
"Jens Andersen" <rayman84@tiscali.co.uk> wrote in message
news:dioq00dj0209fj6mtblcl4nm9
eo5ejifkt@4ax.com...
> On Tue, 20 Jan 2004 09:56:32 -0600, "Daniel P."
> <danutzp1@hotmail.comU> wrote:
>
> Hi
> Interestingly enough there is a difference in code for vb and C# that
> he used for the IO test.
> with his code I got:
> I/O elapsed time: 46497 ms with a max of 1000000
> i: 1000000
> readLine:
> abcdefghijklmnopqrstuvwxyz1234
567890abcefghijklmnopqrstuvwxy
z12345678
> 90abcdefgh
>
> With a few changes to the IO function[1], the result is this:
> I/O elapsed time: 9404 ms with a max of 1000000
> i: 1000000
> readLine:
> abcdefghijklmnopqrstuvwxyz1234
567890abcefghijklmnopqrstuvwxy
z12345678
> 90abcdefgh
>
> The problem is that he is using old vb6 (And below) functions which
> are much slower.
> Since the IO test was the main difference between VB.Net and C#, there
> doesn't seem to be any difference anymore.
> Regards,
> Jens Andersen
>
> [1]
> Dim strWriter As New IO.StreamWriter(fileName)
> Do While (i < ioMax)
> strWriter.WriteLine(myString)
> i += 1
> Loop
> strWriter.Close()
> Dim strReader As New IO.StreamReader(fileName)
> i = 0
> Do While (i < ioMax)
> readLine = strReader.ReadLine()
> i += 1
> Loop
> strReader.Close()
>
>
|
|
|
|
|