fhp - benchs

Descripción del contenido de la página

Módulo del programa fhp para realizar pruebas de velocidad; usado durante la depuración del programa.

Etiquetas:

Código fuente

CR .( fhp-benchs  )

\ Copyright (C) 2006 Marcos Cruz (programandala.net)

\ This file is part of
\ fhp ("Forth HTML Preprocessor") version B-00-201206
\ (http://programandala.net/en.program.fhp).
\ This file makes a speed test for debugging purposes.

\ fhp is free software; you can redistribute it and/or modify
\ it under the terms of the GNU General Public License as published by
\ the Free Software Foundation; either version 2 of the License, or
\ (at your option) any later version.
\
\ fhp is distributed in the hope that it will be useful, but
\ WITHOUT ANY WARRANTY; without even the implied warranty of
\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
\ General Public License for more details.
\
\ You should have received a copy of the GNU General Public License
\ along with fhp; if not, see <http://gnu.org/licenses>.

\ fhp is written in the Forth language
\ with Gforth (http://gnu.org/software/gforth/).

\ .............................................................
\ Init

[undefined] fhp  [IF]   S" fhp.f"  INCLUDED  [THEN]

html-make off
html-echo off

\ .............................................................
\ Benchs

VARIABLE html[-speedtest
VARIABLE html\-speedtest
VARIABLE html(-speedtest

html[-speedtest on
html\-speedtest off
html(-speedtest off

html[-speedtest @ [IF]
CR .( html[ speed test)
TIME&DATE
:NONAME
html[
bla bla bla (long XHTML text here!)
]html
;
DROP -seconds
CR . .( seconds with html[ )
[THEN]

html(-speedtest @ [IF]
CR .( html( speed test)
TIME&DATE
html(
bla bla bla (long XHTML text here!)
)html
-seconds
CR . .( seconds with html( )
[THEN]

html\-speedtest @ [IF]
CR .( html\ speed test)
TIME&DATE
html\
bla bla bla (long XHTML text here!)

-seconds
CR . .( seconds with html\ )
[THEN]

\ 2006-04-26: Results (with Forth 5mx on a Psion 5mx):
\
\ original html[ 423 s
\ html\ 279 s (34% faster)
\ compile mode html[ 61 s
\ interpretation mode html( 399 s