lbForth icon indicating copy to clipboard operation
lbForth copied to clipboard

Ensure x86 performance at least on par with Gforth

Open larsbrinkhoff opened this issue 10 years ago • 1 comments
trafficstars

See e.g. https://groups.google.com/d/msg/comp.lang.forth/YVjtNQwSIH0/YHduzDG4c9EJ

Some may believe that a threaded-code engine written in assembly language would have led to better performance than that exhibited by Gforth. However, looking at http://www.complang.tuwien.ac.at/forth/performance.html, Gforth 0.4.9 performed faster than any of the threaded-code Forth systems written in assembly language (Win32Forth, NT Forth, and eforth) on all of the benchmarks on a 486DX2/66:

The interpretive systems written in assembly language (except eforth opt) are, surprisingly, slower than Gforth. One important reason for the disappointing performance of these systems is probably that they are not written optimally for the 486 (e.g., they use the lods instruction).

larsbrinkhoff avatar Jan 20 '15 07:01 larsbrinkhoff

This runs in 1.4 seconds in the current x86 target, and seconds and 2.5 seconds in gforth-fast.

100000000 constant loops
: test begin ?dup if 1 - else exit then again ;
loops test

By the way, 140 seconds in the C target. Phew!

larsbrinkhoff avatar Dec 07 '15 18:12 larsbrinkhoff