• 0

.NETFX 2.0 slowdowns?


Question

I was wondering if anyone toying with .NET 2.0 and recompiled their applications with it is noticing slowdowns. It seems like something's wrong with some BCL functions. While I was writing some optimized byte array converters I noticed that some .NET 2.0 base classes were slower.

Some raw output, while fiddling with some stuff:

ToInt32 Tests

============================

Filling data...

Testing BitConverter...

BitConverter took 1515,625 ms

Testing Superluminal...

Superluminal took 562,5 ms

Data check... OK!

ToInt64 Tests

============================

Testing BitConverter...

BitConverter took 1468,75 ms

Testing Superluminal...

Superluminal took 984,375 ms

Data check... OK!

ToInt32 Tests

============================

Filling data...

Testing BitConverter...

BitConverter took 3218,75 ms

Testing Superluminal...

Superluminal took 656,25 ms

Data check...

OK!

ToInt64 Tests

============================

Testing BitConverter...

BitConverter took 3156,25 ms

Testing Superluminal...

Superluminal took 984,375 ms

Data check... OK!

Notice how the BitConverter class, which is internal to the CLR (means no managed code, but natively built into the CLR), takes almost double the time. Same applies my own ToInt32 function, which takes a tad longer under .NET 2.0. So is anyone witnessing similar stuff?

Meh.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Seeing as this is a very limited beta you should notify microsoft of your findings.

Link to comment
Share on other sites

  • 0

A lot of people have access to that beta framework, thru different other betas. I'd like to report it, if there was a dedicated channel to do so. I suppose I've to wait for an invitation into the VS beta or until the .NET Framework 2.0 beta starts (which will be public).

I was just wondering if other people noticed similar stuff.

Link to comment
Share on other sites

  • 0

I'd guess that it's most likely just because it's a prerelease version. There's probably a ton of debugging code in the 2.0 builds slowing everything down.

Link to comment
Share on other sites

  • 0
I'd guess that it's most likely just because it's a prerelease version. There's probably a ton of debugging code in the 2.0 builds slowing everything down.

That's my guess too. You might try disassembling System.dll and look at the code for Int32 or something, just to see what it's doing.

Link to comment
Share on other sites

  • 0

There's no managed code for that stuff, because it's also an intrinsic CLR type. Also if you were to look for core functionality, it'd be mscorlib.dll, just as a side note.

There's probably a ton of debugging code in the 2.0 builds slowing everything down.

Maybe true for the BitConverter calls, but a simple loop doing tons of bitshifting operations shouldn't slow down. Especially not when it's heavier counterpart (ToInt64) still needs the same time. The slowdown in my ToInt32 could be blamed that inlining would be disabled in the early beta builds, but there's currently no way to check whether .NET 2.0 performs inlining at all, and how it decides to inline. My functions are written within the rules .NET considers inlining.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.