[fpc-other] Interpreter speed

Bernd Oppolzer bernd.oppolzer at t-online.de
Sat Apr 29 18:18:43 CEST 2023


On the same machine:

PASCAL1 compiled with Stanford Pascal, running on the Hercules emulator:

pp pascal1
EXEC PASCAL PASCAL1
STATE PASCAL1 PASCAL A
EXEC PASCOMP PASCAL1
    **** STANFORD PASCAL COMPILER, OPPOLZER VERSION OF 2023.03 ****

    **** Compiler Summary ****
    ****      No Errors, no Warnings.
    ****   26042 LINE(S) READ,  243 PROCEDURE(S) COMPILED,
    ****   75126 P_INSTRUCTIONS GENERATED,   9.40 SECONDS IN COMPILATION.
EXEC PASC370 PASCAL1
    **** STANFORD PASCAL POST-PROCESSOR, OPPOLZER VERSION OF 2023.03

    ****      NO ASSEMBLY ERROR(S) DETECTED.
    ****  265999 BYTES OF CODE GENERATED,   8.24 SECONDS IN POST_PROCESSING.
EXEC PASLINK PASCAL1
Ready; T=17.71/27.02 18:17:06

Kind regards

Bernd



Am 29.04.2023 um 18:15 schrieb Bernd Oppolzer:
> This may be slightly off-topic, but I can tell you some facts about my 
> Stanford Pascal compiler,
> which runs
>
> - native on z Mainframe machines (which may count as a RISC machine, 
> given the instruction set used)
> - emulated by Hercules, which is a emulator of z Mainframes
> - by emulating P-Code, which is a (sort of) byte code for Pascal ... 
> the P-Code (which is pure text, portable)
> is translated to a byte code representation before execution; static 
> linking is also done in this stage
>
> The times for compiling the compiler (first pass, 26.000 lines) are as 
> follows:
>
> - native on z machine: 0.1 seconds
> - emulating z by Hercules using a very old z operating system: 10 to 
> 12 seconds
> - similar (10 to 15 seconds), when running on Windows and emulating 
> the P-Code;
> this includes the time to translate the P-Code char representation ... 
> depending on the
> power of the used laptop etc., of course.
>
> This makes a factor of 100 for the two emulation strategies, compared 
> to the native execution.
>
> The times are CPU times as reported by the builtin function CLOCK.
>
> Windows example:
>
> c:\work\pascal\work\src>pp pascal1
>
> PCINT (Build 1.0 Jun 15 2022 08:21:21)
>
>    **** STANFORD PASCAL COMPILER, OPPOLZER VERSION OF 2023.03 ****
>
>    **** Compiler Summary ****
>    ****      No Errors, no Warnings.
>    ****   26058 LINE(S) READ,  243 PROCEDURE(S) COMPILED,
>    ****   75130 P_INSTRUCTIONS GENERATED,  13.55 SECONDS IN COMPILATION.
>
> *** EXIT Aufruf mit Parameter = 0 ***
>
> HTH, kind regards
>
> Bernd
>
> http://bernd-oppolzer.de/job9.htm
>
>
> Am 28.04.2023 um 09:20 schrieb Adriaan van Os via fpc-other:
>> Out of curiosity — has anybody compared the speed of
>>
>> 1. interpreting a parsed syntax tree, versus
>> 2. interpreting byte code, versus
>> 3. interpreting a RISC CPU ?
>>
>> Regards,
>>
>> Adriaan van Os
>>
>> _______________________________________________
>> fpc-other maillist  -  fpc-other at lists.freepascal.org
>> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


More information about the fpc-other mailing list