C# vs. VB.NET Speed Test

Hype

Emerald
Emerald Upgrade
1 January 2016
468
0

Reputation:

So I was interested to see which language was faster. So I made a program to test if one was faster than the other.

My findings concluded that VB runs a bit faster than C#. I believed it would be the other way around. They are only ~0.1 seconds apart though, so no GROUNDBREAKING difference. But the VB file is larger by about 4 KB, and that's a lot when both progams aren't in the double 

If you want to try this yourself then here are the copies of the 2 programs, both function the same way but are in different langauges.
https://mega.nz/#!p8REEIhJ!IwnVPEurGa0ZqhJscJvuZv3UQX4YFQwF0vAa2Sm5OyQ
 

bitm0de

Junior
24 May 2016
10
0

Reputation:

Hype said:
So I was interested to see which language was faster. So I made a program to test if one was faster than the other.

My findings concluded that VB runs a bit faster than C#. I believed it would be the other way around. They are only ~0.1 seconds apart though, so no GROUNDBREAKING difference. But the VB file is larger by about 4 KB, and that's a lot when both progams aren't in the double 

If you want to try this yourself then here are the copies of the 2 programs, both function the same way but are in different langauges.
https://mega.nz/#!p8REEIhJ!IwnVPEurGa0ZqhJscJvuZv3UQX4YFQwF0vAa2Sm5OyQ
File is no longer available. But if you actually think VB.NET is faster than C# then you didn't compare equivalent code, or your compiler settings were not the same or you didn't consider the GC or perhaps some other things. I doubt this was tested reliably. They will be pretty much identical for the most part. And the reason for the larger filesize is probably because of that VisualBasic DLL that has the My namespace in it.
 

About Us

Forum Authority is a general discussion forum. We currently have a variety of categories to choose from, where you can participate in discussions. We also have many features such as a powerful credits & awards system, custom upgrades, plugins + more! Here you have the opportunity to meet new people, learn something new, find unique resources & tutorials, win contests & prizes, receive freebies and be given advice or help.

Top