TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ZACK JONES
from: JAMSHID KHOSHRANGI
date: 1995-10-20 23:12:00
subject: Stronger, Better, Faster

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.