Performance...

HaywardIHaywardI Member ✭✭

I am a newcomer to this forum and using c# with Xamarin so forgive me if my question is a little naïve.

I want to build my first app and interface to it a backend system for it's data and business processing. The backend has been written over the years in VB.NET and is very very stable.

Last week I asked a question about linking a Xamarin project to a VB class library which appears to be a non starter so I decided to re-write some of the VB class library into a c# class library.

I completed the conversation of the first couple of routines and decided to test. AND IT WORKED.

BUT at a price. to ensure a the module was properly tested I subject to 1 million operations. This is not unusual for testing and some VB routines have been tested with over a Billion operations. Some may argue this is excessive, but that's subjective and not really this point of this question.

What surprised me about the test was it was visibly slow. The 1 million operations actually took 42 seconds. I therefore decided to copy the methodology and create the same test using the original VB routines. That test took just 7 seconds to complete the 1 million operations.

Now I know I am no where near as accomplished C# programmer as I am VB so I can understand I perhaps didn't code like someone who has been using c# for a long time, but its a BIG difference.

So my question is:

Is this performance difference to be expected? Please consider the routines are in a class library (c# and VB) and invoked via a console app in both cases so near identical and both are running in debug mode.

Thanks in advance for your thoughts.

Sign In or Register to comment.