title: Art: Verification of X took Y ms
body: <p>I've got a warning in my logcat:</p>
  
  <pre><code>W/art: Verification of void com.myapp.LoginFragment$override.lambda$logIn$5(com.myapp.LoginFragment, java.lang.Throwable) took 217.578ms
  </code></pre>
  
  <p>Here's the code:</p>
  
  <pre><code>subscription = viewModel.logIn()
              .observeOn(AndroidSchedulers.mainThread())
              .subscribe(
                 this::showStudioSelection,
                 error -&gt; {
                      ErrorResponse errorResponse = ErrorResponseFactory.create(error);
  
                      if (errorResponse.code() == ApiResult.BAD_REQUEST) {
                         Snackbar.make(getView(), R.string.login_bad_credentials, Snackbar.LENGTH_LONG)
                              .setAction(android.R.string.ok, v -&gt; {})
                              .show();
                      } else {
                          Snackbar.make(getView(), "Unknown error " + errorResponse.code(), Snackbar.LENGTH_LONG)
                              .setAction(android.R.string.ok, v -&gt; {})
                              .show();
                      }
                      viewModel.updateLoginButtonState();
                   }
              );
  </code></pre>
  
  <p>220ms is quite a lot (and I feel like I'm noticing a lag on startup of that Fragment). </p>
  
  <p>I'm using RxJava and retrolambda, but this is not the only spot where this message pops up so I don't think it's directly related.</p>
  
  <p><strong>How can I influence the verification time?</strong> Is it even worth it?</p>
  
  <p>It seems like it has something to do with cyclomatic complexity, since I could get rid of the waring by removing the <code>Snackbar.make</code> calls in the <code>if</code> with some more <em>dry</em> code:</p>
  
  <pre><code>String errorMessage;
  if (errorResponse.code() == ApiResult.BAD_REQUEST) {
      errorMessage = getString(R.string.login_bad_credentials);
  } else {
      errorMessage = "Unknown error " + errorResponse.code();
  }
  </code></pre>