Questions about trimming Smack down

Hi;

I am looking for ways to reduce the cold start time of our app in Android. And I came to the conclusion -which may be wrong- that I can reduce the functionality which Smack loads at startup. Whether this reduction would be significant for our load times is unclear, but I am willing to try. We also use a customized server so we are ceratin of its capabilities, we do not need redundant capability discoveries and whatnot; since some of these XEP implementations attach themselves to all connection instances.

As far as I can see; Smack loads a bunch of static initialization classes and Providers by parsing config and provider xml files. We use a few XEP implementations from extensions and experimental modules, but it looks like everything in a module is loaded when its incorporated. I want to reduce this to loading only what we use from a specific module. Anybody have experience to comment on these?:

  • Is my assumption (that all poviders of used modules are loaded) correct?
  • Is the best way to do this just build Smack from source and refactor these xml configuration files? How about addDisabledClass() mechanism, can it be used for this purpose?
  • Any tips?

Best regards.

The addDisabledSmackClasses() method is the preferred approach to trim down Smack. Ideally in combination with ProGuard.

Note that the code is under GPLv3+.

1 Like

@Flow thanks!