I'm making some code to compete with a C program that was made in
linux. I know PB can smoke this program, I just need some
optimization in my code. Here are the rules of the game:
- 10 meg text file terminated with a CR
- I load the test file into memory and parse it (which I don't need
help doing)
- Then I give back the time of the completed operation
The problem I'm running into is that this C program does all this
on a p133 in about 14 seconds... Mine does it so far at about
35 seconds and 10 seconds of it is just opening the file and
putting the information in memory and then saving it into a new
file. Any help in speeding up the opening and reading the
information faster?
This program will run on a p133, I was also wondering if it could
be increased if I multi-threaded the file -> buffer -> file access?
------------------
-Greg
[This message has been edited by Gregery D Engle (edited August 22, 2000).]
linux. I know PB can smoke this program, I just need some
optimization in my code. Here are the rules of the game:
- 10 meg text file terminated with a CR
- I load the test file into memory and parse it (which I don't need
help doing)
- Then I give back the time of the completed operation
The problem I'm running into is that this C program does all this
on a p133 in about 14 seconds... Mine does it so far at about
35 seconds and 10 seconds of it is just opening the file and
putting the information in memory and then saving it into a new
file. Any help in speeding up the opening and reading the
information faster?
This program will run on a p133, I was also wondering if it could
be increased if I multi-threaded the file -> buffer -> file access?
Code:
#COMPILE EXE '"A:\bunk.exe" #INCLUDE "Win32api.inc" FUNCTION PBMAIN() AS LONG g$ = time$ OPEN "C:\greg.log" FOR BINARY AS #1 sbuffer$=STRING$(LOF(1),0) GET 1,,sbuffer$ CLOSE #1 ... ... REPLACE CHR$(32) with "," In sbuffer$ ... ... OPEN "c:\greg.out" FOR OUTPUT AS #1 CLOSE #1 OPEN "C:\greg.out" FOR BINARY AS #1 PUT 1,,sbuffer$ CLOSE #1 g$ = g$ & $CRLF & TIME$ MSGBOX g$ END FUNCTION
-Greg
[This message has been edited by Gregery D Engle (edited August 22, 2000).]
Comment