[Soot-list] Is it possible to use Soot to count the byte code instruction of a method

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Wed Aug 3 05:42:08 EDT 2011


Hi Anne.

Soot is not the perfect tool for this because, as you may know, almost
all of Soot operates on an intermediate representation called Jimple
that aggregates multiple bytecodes in a single statement. Hence, if
really all you want to do is count bytecodes it would probably be
better to use a more low-level tool like ASM for instance.

Having said that, I am not sure what the relationship is between the
number of bytecodes of a method and its running time. I would suspect
that there is usually not a strong correlation. Methods can have
loops. Also, some instructions are much more expensive than others.
For instance, a field store may trigger swapping in the worst case, or
a new-statement may trigger garbage collection, while a local-variable
assignment is usually very innocent. Pure bytecode counting cannot
capture such differences. But maybe I am misunderstanding what you are
trying to achieve...

Best wishes,
Eric

On 3 August 2011 10:25, anne wu <annesh.love at gmail.com> wrote:
> Hi, every one
>
>      I am doing a project these days that need to measure the cpu running
> time of each method. So I wonder is it possible to use Soot to count the
> byte code instruction of a method? If so, how?
>
>      Any help is appreciate.
>
>      Thank you very much!
>
> Anne
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



-- 
Dr. Eric Bodden, http://bodden.de/
Principal Investigator in Secure Services at CASED
Coordinator of the CASED Advisory Board of Study Affairs
PostDoc at Software Technology Group, Technische Universität Darmstadt
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list