VB.NET Express speed issue

  • Thread starter Thread starter Ali Chambers
  • Start date Start date
A

Ali Chambers

Hi,

I've written a programme that processes stock market price data in
VB.NET 2005 Express. I've optimised the code as much as possible, eg:-
using arrays, not passing parameters to functions, etc...

The code is slow because it is processing large amounts of data many
many times.

However, is there a way to compile the code to other formats to make it
run faster? I've heard of C++ (too difficult for me).

Does the Full Paid Version of VB.NET run code faster than the express
version?

Many thanks,
Alex
 
Ali Chambers said:
Hi,

I've written a programme that processes stock market price data in
VB.NET 2005 Express. I've optimised the code as much as possible, eg:-
using arrays, not passing parameters to functions, etc...

The code is slow because it is processing large amounts of data many
many times.

However, is there a way to compile the code to other formats to make it
run faster? I've heard of C++ (too difficult for me).

Does the Full Paid Version of VB.NET run code faster than the express
version?

No it's the same. If you post a simple sample program that illustrates your
performance problem you're likely to get some advice.

David
 
Ali said:
I've written a programme that processes stock market price data in
VB.NET 2005 Express. I've optimised the code as much as possible, eg:-
using arrays, not passing parameters to functions, etc...

Why would you think that passing parameters to functions would result
in any appreciable performance loss?
The code is slow because it is processing large amounts of data many
many times.

You say the code is slow, how did you measure this? What is the size
of the data you are processing and how long does it take? How long do
you think it *should* take? What is your basis for comparison?

According to the 80/20 rule, the program spends 80% of the time in only
20% of the code. That 20% of the code is what should be measured first
and then the remaining code as needed. I suggest getting a code
profiler and finding out where the bottlenecks actually lie and start
your investigation there.

Since .Net intermediate code is JIT compiled into native machine code,
it should not run any slower than other code.

Good Luck
 
Ali,

In addition to the others,

I think that we are special intereste in that array part, because using real
array's slows down often the process.

All managed code program language from Microsoft create the same end code in
every versie and run all at the same speed.

Cor
 
Thanks for your help. I appreciate the programme may take a long time
to run whatever the language.

I wondered:

a) If MS didn't allow "fast code optimisation" in VB Express - ie.
force you to buy full product to get true speed realisation

b) The code is as follows:

- Price data is held in "double" floating point array, eg:-
highprice(0-9999)
- Comparisons are done between highprice(0-9999) and lowprice(0-9999)
- Buy levels are determined and these buy points held in arrays
- The programme then loops through the price arrays incrementally to
find sell prices - at which it sells and records the price (a basic
description!)

Different levels for buy & selling are tested (too complicated for this
email). On average, the buy/sell routine is called 3 million times per
stock.

c) Are there third party products to speed up the code?

d) Or - off topic - would another language be better?

Sorry - basic questions - but I'm a novice coder.

Alex
 
Looks rather you should review how you proceed (for example the "looping in
an array to find" would make me think an arrayb is not the suitable data
structurss for this particular part)... etc...
 
Sounds to me like you need to store this information in a database and
instead or incrementing through your array to match a specific value,
you should just select it from among 3 million records.
 
I would suggest a Hashtable or a database

if you really want to do everything in memory then a hashtable is the
fastest option

why is a hashtable faster as a "normall" array ( in fact is a hashtable a
special kind of array , same for collections and even datarows etc etc )
see this :
http://en.wikipedia.org/wiki/Hash_table


regards

Michel Posseth [MCP]
 
Back
Top