[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Soot Questions



Hi!

First of all SOOT is a framework so I assume that for most of your point it
does not provide this by default. But I am sure you can solve most of your
problems by extending it in an appropriate way. Also for all these points
counts: Todays JITs are so incredibly high-optimizing that almost none of
these suggestions could bring big runtime improvements IMHO - at least as
long you are using a decent JVM. A JIT is much better at finding actual
bottlenecks than such static analysis.
This counts for most topics. For some however still some additional
comments:

> 2. Does Soot declare classes without subclasses as final?
Not by default. Also it does not make much sense to do so because (at least
for libraries) this would break any code reusability/extension at once.
 
> 3. Is there a strength reduction facility?
>      a. >> & << for * & /
>      b. m & n - 1 for m % n, where n is a power of 2
No clue what you mean by that, sorry... you want to change language
semantics for these operators?

> 4. Replace String + with StringBuffer.append()?  (Requires
> the addition of a new StringBuffer, which may cause an
> unexpected OutOfMemoryError.)
Again: Not by default but should be quite easily done.
 
> 5. Move class-declared constants into an interface.  (This
> could break reflection, but for those who know they aren't
> using it ...)  This saves space because constants defined
> using "static final" are included in the class file, and
> inlined when used.  From an OO point of view, an interface
> should define a type (thus not be a collection of constants),
> but from a Java point of view, there's room for some optimization.
I do not see why that should give any speed or space improvements. It could
even slow down the code because an additional class (the interface) would
have to be loaded at runtime.

Again, that's my opinion. Probably someone can correct me on the one or
other point...

Cheers,
Eric

-- 
Eric Bodden
RWTH Aachen University
ICQ UIN: 12656220
Website: http://www.bodden.de
PGP key: http://www.bodden.de/pub_key.asc