ZJ>One of the programs
ZJ>I run is a little utility which displays a file to folks as
ZJ>they are logging into my BBS which shows the number of
ZJ>connections by various baud rates. Over the next few
ZJ>messages I want to post the PB code I've written and get
ZJ>some tips, etc on how I can make the program run as fast as
ZJ>possible. I've done some benchmarking using TurboPower's
ZJ>Bench utility and right now my PB version is much slower
ZJ>than my Pascal version.
Some speed hints that I've come up with:
1. Avoid SELECT CASE. Use ON GOSUB in time CRITICAL loops.
SELECT CASE is easier to read, but slower. If you MUST use
select case, put the most common hits at the top of the list,
the less common ones at the bottom.
2. Fold your constants manually. Don't put 10*2 when 20 is what
you mean, since the PB compiler does not fold. Work long
expressions out as much as you can to avoid slow code.
3.Turn off all error handling in the final release. Error
checking (BOUNDS, etc) takes time.
Jamshid
--- Maximus/2 2.01wb
---------------
* Origin: Sound Stage BBS - Live Via Satellite - (604)944-6476 (1:153/7070)
|