Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Performance of threaded interpreter on hyper-threaded CPU
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-04-25 (22:52)
From: Joaquin Cuenca Abela <e98cuenc@y...>
Subject: Re: [Caml-list] Re: Performance of threaded interpreter on hyper-threaded CPU
Michel wrote:

> I'm aware of the problem due to gcc's cross-jumping "optimisation"
> (described as you mention by Ertl in [1]). For the record, I tried
> disabling it with -fno-crossjumping, but as Ertl mention, this didn't
> change anything. However, judging by the versions of gcc I'm using,
> cross-jumping should also be performed on the second machine, for
> which threaded code provides a noticable gain...


FWIW, I did some tests with gcc 3.4.2, and -fno-crossjumping works *sometimes*. If you combine it with -O2 *and* your virtual machine has less than 10 opcodes (??) then -fno-crossjumping works as expected.

Otherwise (ie, with any real virtual machine) gcc generates an extra jump, but you don't get exactly the same assembler than if you use a switched vm. The assembly for the switched vm pushes more instructions in the extra basic block than the assembly for the threaded vm.

In the threaded vm, the extra block is only (in my test) a jmp *%eax.


Joaquin Cuenca Abela