On the effect of branch mispredictions in the Squeak VM

John M McIntosh johnmci at mac.com
Mon Jul 7 09:36:24 UTC 2003


> From:  "Andreas Raab" <andreas.raab at g...>
>  ...
> I set up a little benchmark (which is attached) that runs the same  
> bytecodes
> with some re-ordering (applied to maximize/minimize the effect of the
> dispatch) and run it. Here are the results:
>
> iterations        well-predicted(msecs)        mispredicted(msecs)
> 10        0        0
> 100        0        0
> 1000        0        1
> 10000        3        7
> 100000        24        68
> 1000000        247        673
> 10000000        2463        6722
>
> The interesting fact of the matter is that we spend about 2.7 times as  
> much
> when we have branch mispredictions as without them. I'd be delighted if
> someone could review the benchmarks itself in order to ensure that I  
> haven't
> done anything wrongly and that the results itself are valid.
>


My numbers using mac vm 3.5.2b1 (500Mhz G3) are:

10	0	0
100	0	0
1000	1	1
10000	8	7
100000	77	78
1000000	797	781
10000000	7817	7861

again
10	0	0
100	0	0
1000	1	1
10000	15	8
100000	78	77
1000000	786	776
10000000	7809	7819

Perhaps someone else can confirm these?

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===



More information about the Squeak-dev mailing list