[Soot-list] How to use soot as an effective command line bytecode optimizer

Eric Bodden eric.bodden at mail.mcgill.ca
Thu May 24 14:23:57 EDT 2007


On 24/05/07, Mark Friedman <mark.friedman at gmail.com> wrote:
> After reading as much of the Soot documentation as I could in last couple of
> days, I'm still confused as to how to use soot as an effective command line
> bytecode optimizer.  In particular, a few things remain obscure to me.  The
> first is whether whole-program mode and whole-program optimization is
> 'safe', i.e. will whole-program optimizations produce incorrect code if it
> turns out that the program loads unknown files through reflection or other
> means.

Yes, in general that might be the case. However, you can use the
-dynamic-* options (see
http://www.sable.mcgill.ca/soot/tutorial/usage/) to tell Soot, which
classes *might* be loaded. If this set includes all classes that might
possibly be loaded, Soot will make appropriate worst-case assumptions,
taking those classes into account.In a nutshell, if only these classes
are loaded dynamically and not others, whole program mode should be
safe even with dynamic class loading.

> The second issue is some guidance on which analysis and optimization
> phases should be used for the most effective performance optimizations?  I
> know that in some cases there might be time-space tradeoffs and I would be
> interested in knowing where there tradeoffs might apply.

This is hard to say in general. I guess it depends on the program you
want to optimize, whether you want to optimize for time or space and
on how much compile time you are willing to sacrifice.

> Finally, it's not
> clear to me which, if any, phases are executed by default and which ones
> must be turned on explicitly.

This is stated in the document about phase options:
http://www.sable.mcgill.ca/soot/tutorial/phase/

Eric

-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list