Click to See Complete Forum and Search --> : how speed up application


kohlimannu
May 4th, 2006, 12:35 AM
Hi all

i m code like this



Function ReadFile()
'This function read a class file having around 1 lack line
' im using stream reader for that
' and then store all function name from that file and store them in a data table '

'now calling another function in a loop
for i=0 to datatable.row .count-1
ReadSubFunction(here im passing the stream reader which opened in the current fucntion,and the function so i can find the sub function )
next i


End Function


Function ReadSubFunction(sr as streamreader, searchFunction as string)
'now im reading that file again line by line to read all sub function of searchFunction

End Function


Actually my this code consume 100% CPU .
is there any way to speed up and keep free CPU

Craig Gemmill
May 4th, 2006, 01:46 AM
The exact contents of each function would help to figure out what's going on.

HanneSThEGreaT
May 4th, 2006, 02:08 AM
There may be numerous ways to achieve what you want, we don't know what you want to achieve, so please give us the full picture of what you're trying, then we can help you better..:thumb:

LaxRoth
May 4th, 2006, 04:41 AM
File reading is always slow...insert a slower harddisk and you won't see a high cpu usage anymore.

What you want to do? Count lines?

yuvipanda
May 4th, 2006, 08:19 AM
This code is no good : YOu need to give the actual code in the ReadSubFunction before we can help