[Gambas-user] New Jit system merged on master

Jussi Lahtinen jussi.lahtinen at gmail.com
Wed Jun 13 03:05:35 CEST 2018


1. Behaviour discrepancy between loops run with interpreter and JIT. See
attachment (NewJITtest-0.0.1).
2. Bug with arrays as arguments. See attachment (NewJITtest-0.0.2).

I bet you will get a lot more, when the rest of the features are
implemented. I have talent for this...


Jussi


On Wed, Jun 13, 2018 at 2:38 AM, Benoît Minisini <g4mba5 at gmail.com> wrote:

> Hi,
>
> I have just merged the 'jit-with-c' branch to 'master'.
>
> The JIT compiler is not finished, but is advanced enough to run all the
> fast methods of the IDE, the gb.form.editor and the gb.form.terminal
> components. The benchmarks run too.
>
> Many features are still not implemented:
>
> - Functions with variable number of arguments.
> - Structures.
> - Static arrays.
> - ON GOTO and ON GOSUB.
> - Error management.
> - BYREF.
> - Extern functions.
> - WITH ... END WITH.
>
> And many implemented features are not tested.
>
> And many optimizations could be done too, especially in properties and
> methods calls, that are mostly run by the interpreter at the moment.
>
> The performance gain is about the same as the old JIT compiler. Often a
> bit slower, sometimes unexpectedly faster. The biggest gains are when
> dealing with loops, integers and native arrays. On the other side, you
> won't gain anything with string routines, the 'string' benchmark even being
> a bit slower!
>
> Note that the JIT compiler is not a compiler, but a Gambas to C
> translator, about 3,000 lines of code, whose result is preprocessed,
> compiled and linked by the gcc compiler at runtime.
>
> To disable the JIT compiler, set the environment variable GB_NO_JIT to 1.
> To have some debugging messages, set GB_JIT_DEBUG to 1.
>
> Otherwise, I fixed the thousand separator management in the Format()
> function, and optimized the string search routine used by InStr(), RInstr()
> and Replace(). The "string" benchmark now runs 4 times faster.
>
> Apart from the previous limitations, you can start to play with it, to
> help me test the following:
>
> - Does it work with 32 bits x86?
> - Does it work with ARM?
> - Does it work with clang?
> - ...
>
> Enjoy it!
>
> --
> Benoît Minisini
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180613/df561c35/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NewJITtest-0.0.1.tar.gz
Type: application/gzip
Size: 11396 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180613/df561c35/attachment-0002.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NewJITtest-0.0.2.tar.gz
Type: application/gzip
Size: 11420 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180613/df561c35/attachment-0003.gz>


More information about the User mailing list