Login process code flow

I am learning openfire source code, want to know the login process. We develop app, find that Android client is very slow to login, so I want to improve the login process on server side or Andriod side.

Could someone help me know the login process and the code flow? It is better if can provide some suggestions for improving login process, thanks in advance.