Clash of the unlikely: C# versus... RealBASIC?
-
I use C# with .NET or Mono on a daily basis. To be honest, I love the language. It’s clean, efficient and simple. Yesterday however, I suggested on IRC that whilst C# has definately benefited OpenSim with its simple debugging, rapid development and wide selection of prebuilt classes to choose from, it was not a great choice for what is, essentially, a high performance application. Upon stating this, a couple of people chirped up to tell me that while a language like C or C++ would provide better performance, I would be suprised how far JIT compilers have come. I decided to put this to the test.
More evidence that how you code is just as important as what you code it in?
-
I use C# with .NET or Mono on a daily basis. To be honest, I love the language. It’s clean, efficient and simple. Yesterday however, I suggested on IRC that whilst C# has definately benefited OpenSim with its simple debugging, rapid development and wide selection of prebuilt classes to choose from, it was not a great choice for what is, essentially, a high performance application. Upon stating this, a couple of people chirped up to tell me that while a language like C or C++ would provide better performance, I would be suprised how far JIT compilers have come. I decided to put this to the test.
More evidence that how you code is just as important as what you code it in?
-
I use C# with .NET or Mono on a daily basis. To be honest, I love the language. It’s clean, efficient and simple. Yesterday however, I suggested on IRC that whilst C# has definately benefited OpenSim with its simple debugging, rapid development and wide selection of prebuilt classes to choose from, it was not a great choice for what is, essentially, a high performance application. Upon stating this, a couple of people chirped up to tell me that while a language like C or C++ would provide better performance, I would be suprised how far JIT compilers have come. I decided to put this to the test.
More evidence that how you code is just as important as what you code it in?
I've had the misfortune to use RealBASIC in the past. I remember the IDE not letting you view the code for a form, class or whatever in one piece. Instead you had to choose a method or property declaration from a dropdown at the top of the code window, and you could only see that. An unintuitive and fundamentally unproductive IDE complete with a language that is VB6 more or less. Bleh.
-
I use C# with .NET or Mono on a daily basis. To be honest, I love the language. It’s clean, efficient and simple. Yesterday however, I suggested on IRC that whilst C# has definately benefited OpenSim with its simple debugging, rapid development and wide selection of prebuilt classes to choose from, it was not a great choice for what is, essentially, a high performance application. Upon stating this, a couple of people chirped up to tell me that while a language like C or C++ would provide better performance, I would be suprised how far JIT compilers have come. I decided to put this to the test.
More evidence that how you code is just as important as what you code it in?
First paragraph, highlighted in red in the original article;
Edit: This article has just been featured on HackerNews, but it’s very old. The code I used here for the comparison is suboptimal – the results here should not be considered accurate. I’m leaving this here for archive purposes only.
Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
-
I use C# with .NET or Mono on a daily basis. To be honest, I love the language. It’s clean, efficient and simple. Yesterday however, I suggested on IRC that whilst C# has definately benefited OpenSim with its simple debugging, rapid development and wide selection of prebuilt classes to choose from, it was not a great choice for what is, essentially, a high performance application. Upon stating this, a couple of people chirped up to tell me that while a language like C or C++ would provide better performance, I would be suprised how far JIT compilers have come. I decided to put this to the test.
More evidence that how you code is just as important as what you code it in?
Broken link!
tomgrimshaw.wordpress.com is no longer available.
The authors have deleted this blog.
Regards, Nish
My technology blog: voidnish.wordpress.com
-
Broken link!
tomgrimshaw.wordpress.com is no longer available.
The authors have deleted this blog.
Regards, Nish
My technology blog: voidnish.wordpress.com
I still have the associated source in my history Original C# code: http://pastebin.com/f287a2609[^] RealBASIC code: http://pastebin.com/f22e9ffa2[^] One of the optimizations to the C# code done by a commenter: http://pastebin.com/3765W95A[^] (I guess RealBASIC doesn't have an equivalent to Stopwatch?) I think there were a few other code postings but that last one was the only submission I took a look at before realizing how old this blog entry was...
-
I use C# with .NET or Mono on a daily basis. To be honest, I love the language. It’s clean, efficient and simple. Yesterday however, I suggested on IRC that whilst C# has definately benefited OpenSim with its simple debugging, rapid development and wide selection of prebuilt classes to choose from, it was not a great choice for what is, essentially, a high performance application. Upon stating this, a couple of people chirped up to tell me that while a language like C or C++ would provide better performance, I would be suprised how far JIT compilers have come. I decided to put this to the test.
More evidence that how you code is just as important as what you code it in?
Anything can run on a high spec machine. If you want to know how efficient a language is, try running the executables on say WXP or W2K with 256Mb on a PIII. The difference is that some programs written in languages like Java and C# can take forever to run on environments with low resources, even in JIT. If the code does not involve any libraries, then I agree, JIT C# is as fast as anything else you can get on the market. Once you start going into .net framework, what happens is anyone's guess. Some things are faster than libc, some are a lot slower. eg C# dictionary vs C++ map vs C bsearch vs MFC map vs MS C++ hashmap. To use any language in a real-time system, you need all your new's up front and ensure no garbage collection once it starts running. The random GC really screws the system big time. I have used C# in realtime systems before (just for fun at lunchtime). Scary what happens when GC kicks in - the machine actually starts juddering. Someone told me my aeroplane would have dropped out of the sky, possibly gone into a steep dive, if that had happened in a real life situation!