Optimization by factorizing code pattern

  • Anonymous

    Anonymous - 2012-10-15

    Dear all,
    I'm currently using proguard in my build chain to produce code to be loaded on embedded devices. My main interest is clearly size.
    I've gone through many cases where the optimization could be done by fatorizing common code pattern as synthetic private methods. Even if we are a bit less efficient due to the call and return, for real applications, the amount of occurences can be significant !

    What do you think of such optimizations ? Is it doable within proguard ? Are there any work related to this (i've not been able to find any, so I'm asking before rushing into some experiments)

    Thanks in advance,

  • Eric Lafortune

    Eric Lafortune - 2013-01-24

    A very late reply... ProGuard is typically doing the opposite: inlining short methods where ever possible. This improves performance and size of the code, because short methods carry quite some overhead. Extracting larger methods seems less common (and more difficult to detect). You could do some manual experiments.



Log in to post a comment.