[Mono-devel-list] Continuous Optimization: Update

Willibald Krenn Willibald.Krenn at gmx.at
Mon May 2 14:20:41 EDT 2005


Hi!

I just wanted to give everyone a quick update on my work on some continuous 
optimization framework for mono: I've finished my first prototype now and the 
initial evaluation is also done;
You can find a draft version of my paper and some patches (AMD64) for the 
framework here: http://www.wpkrenn.net/pmwiki/pmwiki.php/Willi/MiniAMD64


I also want to show you some numbers I got when running some simple 'benchmarks' 
to kinda support the inclusion of reoptimization in the official mono JIT.
All figures are based on a modified mono JIT for AMD64 (rev. 42137), but should 
not be way off the current JIT.

I SciMark 2.0 (x87)
~~~~~~~~~~~~~~~~~~~
                            Total, FFT, SOR,   MC, MULT,  LU
Mono rev. 43413           :  178, 124, 446, 7.86,  150, 164
No Continuous Optimization:  181, 122, 461, 9.29,  150, 164
Recompilation; No Reopt(1):  181, 123, 463, 7.67,  149, 163
Recompilation; With Reopt:   204, 123, 466, 7.62,  156, 267
Mono with full optimizations:205, 109, 466, 8.46,  172, 269

(1): No reoptimization of methods that are recompiled is made.
Normal Optimizations:
   Peephole, CFold, Branch, Linears, Intrins, Loop, Aot
Full Optimizations and Optimizations used for reopt:
   Normal Optimizations plus ABCRemoval, SSAPRE, CONSPROP, FCMOV,
   COPYPROP, CMOV, TAILC, LEAF
   (I left out inlining because this seemed to hurt performance.)

The drop in the MC (Monte Carlo) column comes from the fact that recompilable 
methods force the use of indirect function calls and the MC test is basically a 
synchronized function call test..

As can be seen from the figures, reoptimization at runtime almost reaches the 
performance of mono with full optimizations turned on by default! (In reality 
the composite score for the reoptimizing version is 204 ± 1.57 (95% confidence 
interval) - so it can even surpass the fullopt version (204.86 ± 0.18)...)

II MCS compile time
~~~~~~~~~~~~~~~~~~~

No Continuous Optimization:    205 seconds
Recompilation; With Reopt:     207 seconds (0 methods recompiled)
Mono with full optimizations:  228 seconds


Here we can see another nice property of the framework: While the full 
optimizing version of the JIT needed 228 seconds, my framework only slowed down 
the build process by 2 seconds or 1%.


Personally, I think it would be worthwhile to integrate some version of the 
continuous optimization framework in the official mono JIT and use it / expand 
it as some platform to add new optimizations to. Due to the dynamic nature of 
the framework, one particular optimization could be provided in several 'cost' 
flavours, so that some clever algorithm can maximize performance gains while 
minimizing the costs..

Thanks,
  Willi




More information about the Mono-devel-list mailing list