I've been playing around with trying to speed up some definitions and making them into primitives. An 8-bit computer is all that is needed in most respects. But locating words across a multitude of screens really lacks in that department.
A couple of ideas crossed my mind, and have shown some improvement in speed. But could still be better. The order of progression went something like this.
1) use Forth for all loops and comparisons 2) use primitive to match word one word at a time. 3) use primitive to find a word within a line. 4) use primitive to find a word within a screen. 5) use primitive to find a word within 16k block of screens or up to 16k text file fully in memory
All times are at 1 Mhz Step 1 takes about 75 seconds Step 2 takes about 55 seconds Step 3 takes about 40 seconds Step 4 takes about 2 seconds Step 5 not tested yet, but should even be much faster than step 4.
Both the screens methods are very fast at 1 Mhz and greatly increases Forth's fun factor on an 8-bit machine.
Searching through 100's of screens now is no longer a chore.
|