More Profiling

Hernan Wilkinson hernan.wilkinson at bancogalicia.com.ar
Thu Sep 27 18:43:19 UTC 2001


Hi everybody,
     I'm really enyoing this thread but don't have enough time to
participate actively, so I decided to share with you the work I have done
for my Master Thesis.
     The thesis was about "method lookup". I started with an idea, ended
with another.... anyway, common problems.
     But there is something that I did that can be usefull for this kind of
"profiling" and research.
     Scott Crosby wrote:
                                                                           
                                      >                                    
                                                                           
                                      >QUERY: Can I write my caching code  
                                      into a seperate class, yet have the  
                                      >C-translater still inline all of    
                                      the methods? It'd help a lot;        
                                      Interpreter                          
                                      >is pretty unwieldy to browse&alter. 
                                                                           
                                                                           
                                                                           

     Well, I have wrote a "framework" that helps to change the method
lookup algorithm and used it with many method lookup implementations.
     One thing that I concluded in my thesis for example, was that making
the method cache bigger make the method lookup take longer (At least with
Squeak I thought we could get better performance)
     I does not fullfill Scott requeriment because I did not converted the
framework to C code, I just run it inside Squeak.

     The frameworks extends the interpreter in such a way that forwards the
method lookup to another class.
     Like I said, it runs inside Squeak (I did not generate a new virtual
machine) so time measureaments are affected by the real Squeak's virtual
machine.
     Here is a short description of how it works and how to use it.

     1) The class ConfigMLInterpreter (not the best name) subclasses
InterpreterSimulatorLSB. This class redefines the method lookup methods and
forwards the lookup to a MethodLookupStrategy object
     2) MethodLookupStrategy has many implementations, one of them is
DispatchTableSearchML (the basic lookup algorithm) and CachingStrategy
     3) CachingStrategy has many implementations, one of them is
GlobalCachingStrategy that is the copy of the current Squeak algorithm. It
uses the same caching algorithm, etc.
     4) You can define profilers for each MethodLookupStrategy and
CachingStrategy. There are some implemented already that take time
measurements.
     5) There is a class StopWatch, that uses the real time clock to get
better time measurement resolution. I implemented a bunch of primitives in
C code that uses that clock. This primitives are only valid in a Windows
operating system.
     6) The idea is that with this framework you can run another Squeak
image that has all the tests that you want to do. I used a WinCE image that
has some tests, for example, compile a method, decompile a method, read a
file, etc.
     7) The image that contains the tests, comunicates with the "virtual
machine" running on Squeak throught primitives that are implememented in
ConfigMLInterpreter

     How to use it:
     The class ConfigMLInterpreter has a class message named #run:
anImageFileName using: aMethodLookupStrategyClass to start running another
Squeak image.
     It has some shortcats, for example #runUsingGLC that starts the
running the image with the Squeak's algorithm.
     It the Squeak image that is beeing run inside the original Squeak,
there is a ThesisBenchmarks class that has messages to run predifined test
like
     #runAllTestsUsingDispatchTableSearchML, #runAllTestsUsingGLCWithDTS,
etc.
     The test's result are printed in the original Squeak Transcript

     I implemented it with a Squeak 2.7 image. This is the only English
documentation I have since the thesis is written in Spanish.
     Well I hope this helps.
     Here are the files:
     1) Framework.zip: It contains the framework's code. Must be file it in
the main image.
     2) testClasses.zip: It contains the test's classes that have to be
file in in the image that will be run inside the Squeak with the framework
     3) Interp.zip: It has the changes I made to the file Interp.c to
support the real time clock primitives. The changes are mark with the
letters HAW

     I have UML diagrams that show how this thing works, and of course, an
doc written in Spanish.
     Any question or suggestion will be welcome.

     Bye, Hernan.

(See attached file: Framework.zip)(See attached file: TestClasses.zip)(See
attached file: Interp.zip)


--------------------------------------------------------------
Hernán A. Wilkinson
Arquitectura Tecnologica - Arquitectura Corporativa
Gerencia de Sistemas - Banco Galicia
Tte. Gral. J. Perón 537,  2 "B"  C1038AAK
Tel.: (54- 11) 6329-4630
Fax: (54- 11) 4329-6568
e-mail: hernan.wilkinson at bancogalicia.com.ar




===============================================================
La información contenida en este correo es para uso exclusivo de los
destinatarios del mismo. Está prohibido a las personas o entidades
que no sean los destinatarios de este correo, realizar cualquier tipo de
modificación, copia o distribución del mismo. Si Ud. recibe este correo
por error, tenga a bien notificar al emisor y eliminarlo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: =?iso-8859-1?Q?Framework.zip?=
Type: application/zip
Size: 19945 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010927/c7605fad/iso-8859-1QFramework.zip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: =?iso-8859-1?Q?TestClasses.zip?=
Type: application/zip
Size: 9285 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010927/c7605fad/iso-8859-1QTestClasses.zip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: =?iso-8859-1?Q?Interp.zip?=
Type: application/zip
Size: 148312 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010927/c7605fad/iso-8859-1QInterp.zip


More information about the Squeak-dev mailing list