Objectmix
Tags Register Mark Forums Read

Question about gforth speed : Forth

This is a discussion on Question about gforth speed within the Forth forums in Programming Languages category; Hello, during the last days i have been using gForth under Linux, and i have liked it a lot. One thing i liked is the concept of "primitive centric threaded code". So i have made a prototype of a forth virtual machine using this concept in assembly language for i386 Linux. I expected my code to be faster than gForth because gForth is written in C, but to my surprise, it turns that gForth is even faster: : prog 100000000 for i drop next ; (3 seconds in assembly prototype) : prog 100000000 for i drop next ; (1.5 seconds ...


Object Mix > Programming Languages > Forth > Question about gforth speed

Forth Forth programming language

Reply

 

LinkBack Thread Tools
  #1  
Old 03-26-2009, 10:34 AM
Junior Member
 
Join Date: Mar 2009
Posts: 1
enrique is on a distinguished road
Default Question about gforth speed

Hello,

during the last days i have been using gForth under Linux, and i have liked it a lot. One thing i liked is the concept of "primitive centric threaded code". So i have made a prototype of a forth virtual machine using this concept in assembly language for i386 Linux.

I expected my code to be faster than gForth because gForth is written in C, but to my surprise, it turns that gForth is even faster:

: prog 100000000 for i drop next ;
(3 seconds in assembly prototype)
: prog 100000000 for i drop next ;
(1.5 seconds in gForth)

I have no clue about what's happening here, does someone know what could be happening?

I show the assembly code for NEXT, DOCOLON, SEMICOLON:


macro NEXT: lodsd
jump eax

docol: lodsd
xchg esp,ebp
push esi
xchg esp,ebp
mov esi,eax
NEXT
semicol: xchg esp,ebp
pop esi
xchg esp,ebp
NEXT
Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
RE: Execution speed question usenet Python 0 07-29-2008 04:17 PM
Execution speed question usenet Python 25 07-29-2008 11:20 AM
Why do these GForth programs fail with gforth-fast? usenet Forth 3 07-10-2008 05:00 AM
Why do these GForth programs fail with gforth-fast? usenet Forth 0 07-09-2008 01:02 PM
Speed Question usenet PHP 3 07-19-2002 08:42 AM


All times are GMT -5. The time now is 09:42 AM.