| Re: primitives vs cleverness vs readability |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.forth · Group Profile
Author: Stephen PelcStephen Pelc Date: Aug 4, 2008 09:41
On 4 Aug 2008 10:45:30 +1200, DavidM nowhere.com> wrote:
>As we all know, all VMs regardless of the language can impose huge run-
>time performance penalties, compared to native coding in native compiled
>languages.
>
>An STC-based Forth with optimal hand-coded assembler primitives can evade
>this cost to a large degree, so I won't be talking about that here. I'm
>thinking more of DTC, ITC and TTC-based forths.
>
>What I am interested in is: when is it better to sweat over the coding of
>forth words, squeezing every last ounce of speed out of them at the very
>likely cost of readability/maintainability, as opposed to just taking the
>time critical stuff and coding it as C and/or assembler primitives?
It depends what the VM is for! When MPE and Forth Inc were working on
the OTA virtual machine, we found that if the high level portion of
the system (I/O, database ...) was sufficiently high-level, the
payment terminal applications spent most of their time in the high
level functions. I do not remember the numbers ... it was a long time
agao.
OTA was a token threaded 32 bit system. Underneath that, depending
on the CPU were DTC and STC Forth kernels for CPUs like 80186/V25,
8051 and 68000.
Stephen
--
Stephen Pelc, stephenXXX@ mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads
|