title: How to speed up the Firebase authentication process
body: <p>I have an Android app with Firebase-backed storage. For authentication, I'm using a Google sign-in, followed by Firebase's <code>signInWithCredential()</code>.</p>
  
  <p>This is sometimes reasonably fast, some other times very slow (2 seconds for the Google sign-in, 6 seconds for Firebase, sometimes longer). This is not acceptable from a UX point of view, especially since this happens every single time the user starts the app.</p>
  
  <p>Is there anything I can do to speed things up?</p>
  
  <p>In a nutshell, with all async handling removed:</p>
  
  <pre><code>result = Auth.GoogleSignInApi.silentSignIn(googleApiClient).get();
  // --- That can take over two seconds ---
  
  GoogleSignInAccount acct = result.getSignInAccount();
  AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
  authTask = auth.signInWithCredential(credential);
  // --- This can take over six seconds ---
  </code></pre>