Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Michel Schinz <Michel.Schinz@e...>
Subject: Re: Performance of threaded interpreter on hyper-threaded CPU
"Till Varoquaux" <till.varoquaux@gmail.com> writes:

[...]

> Could you try running your multithreaded code on only one of the
> virtual cpu to see the improvement hyperthreading really brings in?

To clarify things: I'm not talking about a multi-threaded program.

"Threaded code" is a technique which is commonly used to speed up
dispatching in interpreters. It is relatively well described on the
following page:

http://www.complang.tuwien.ac.at/forth/threaded-code.html

The OCaml VM is written in such a way that it uses that technique if
possible (basically if it is compiled using a recent gcc, which offers
the extensions needed to implement threaded code), and falls back to a
"standard" switch-based dispatching technique otherwise.

My observation is that in some circumstances, threaded code seems to
slow down the VM instead of speeding it up as it should. (The biggest
slowdown being observed on a hyper-threaded architecture, but I have
no idea why).

Michel.