English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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-18 (12:00)
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:


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).