[Soot-list] Time estimtion of Jimple

Richard L. Halpert richard.halpert at mail.mcgill.ca
Wed Jan 21 12:54:43 EST 2009


Amir,
The nature of Java Bytecode is that it gets interpreted or
just-in-time-compiled differently depending on the environment in which it
is run.  You simply cannot make guarantees that a certain bytecode will be
executed in a certain amount of time (except perhaps in real-time Java).

Furthermore, even if you can estimate how long each statement will take, you
still cannot know for sure how long an entire method will take, because a
method may have different length control paths.

Finally, you can't know for sure whether two methods will even be compiled
similarly by the JVM.  The JVM could choose to optimize one method more than
another.

Still, if you're willing to accept a LOT of uncertainty in your results, you
could go ahead and estimate the relative lengths of the methods.  You would
have to create your own list of relative lengths of Jimple statements (or
perhaps work with a different intermediate representation... Baf is much
closer to Java Bytecode than Jimple is).

Personally, I don't think this effort would be worthwhile because your
results would be incredibly unreliable.  If you need more accurate data, you
should consider a dynamic analysis instead of a static one.  What is your
actual goal?  Why are you trying to put longer methods first?

-Richard

On Wed, Jan 21, 2009 at 12:39 AM, Amir Mehrabi <mehrabi at comp.iust.ac.ir>wrote:

>  Hi Eric
> I want to compare two method by estimating time to excute of each method
> I want to move the method invoke in the body of another method
> I want to know which one of these method must be the first invocation.
> if I know which one excuting longer than other it is very helpful for me.
> may be cycle of each instruction in jimple would be useful
>
> ex:
> public void foo(){
> ...
> ...
> ...
> ...
> c=A.invoke(a);
> ..
> ..
> ..
> d=B.invoke(b);
> ..
> }
>
> I want to convert these subprgoram to:
> if *B.Invoke* has more time to excute
>
> public void foo(){
> ...
> *d=B.invoke(b);*
> c=A.invoke(a);
> ...
> ...
> ...
> }
>
> but if A.Invoke has more time to excute this subprogram must be converted
> to:
> public void foo(){
> ...
> *c=A.invoke(a);*
> d=B.invoke(b);
> ...
> ...
> ...
> }
>
> i'm sorry for may bad english writting ;)
>
> Thanks
> Amir Mehrabi
>
> -----Original Message-----
> From: Eric Bodden <eric.bodden at mail.mcgill.ca>
> To: Amir Mehrabi <mehrabi at comp.iust.ac.ir>
> Cc: soot-list at sable.mcgill.ca
> Date: Tue, 20 Jan 2009 08:25:07 -0500
> Subject: Re: [Soot-list] Time estimtion of Jimple
>
> Hi Amir.
>
> Not that I am aware of. The time really depends on the JVM and on the
> optimization level which the JVM has compiled the bytecode code to. IF
> you use real-time Java you may get some guarantees, but not otherwise,
> as far as I know.
>
> Eric
>
> 2009/1/19 Amir Mehrabi <mehrabi at comp.iust.ac.ir>:
> > Hi
> >
> > Is there any way to estimate cycle of each jimple statement?
> >
> > Thanks
> >
> > Amir Mehrabi J.
> > MSc Student of IUST in Software Engineering.
> >
> >
> > _______________________________________________
> > Soot-list mailing list
> > Soot-list at sable.mcgill.ca
> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> >
>
>
>
> --
> Eric Bodden
> Sable Research Group, McGill University
> Montréal, Québec, Canada
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20090121/58708703/attachment.html 


More information about the Soot-list mailing list