[Speed] Disable hash randomization to get reliable benchmarks

Antonio Cuni anto.cuni at gmail.com
Tue Apr 26 05:03:14 EDT 2016


Hi Armin,


On Tue, Apr 26, 2016 at 10:56 AM, Armin Rigo <arigo at tunes.org> wrote:

> Hi,
>
> On 25 April 2016 at 08:25, Maciej Fijalkowski <fijall at gmail.com> wrote:
> > The problem with disabled ASLR is that you change the measurment from
> > a statistical distribution, to one draw from a statistical
> > distribution repeatedly. There is no going around doing multiple runs
> > and doing an average on that.
>
> You should mention that it is usually enough to do the following:
> instead of running once with PYTHONHASHSEED=0, run five or ten times
> with PYTHONHASHSEED in range(5 or 10).  In this way, you get all
> benefits: not-too-long benchmarking, no randomness, but still some
> statistically relevant sampling.
>

​note that here there are two sources of "randomness": one is
PYTHONHASHSEED (which you can control with the env variable), the other is
ASLR​ which, AFAIK, you cannot control in the same fine way: you can only
either enable or disable it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/speed/attachments/20160426/44bba03e/attachment.html>


More information about the Speed mailing list