title: [JWT][JJWT] Function compact() very slow
body: <p>I use lib JJWT 0.9.0 to generate Token.
  I have write log code segment generate Token, and I see function compact() run verry slow (664 -151 = 513(ms)) . how to the function compact() run faster or How to generate tokens faster?
  I use JDK7. </p>
  
  <p>My code:</p>
  
  <pre><code>public String createJWT(String id, String issuer, String subject, List&lt;T&gt; authories, String loginUserData,
              long ttlMillis) {
          //The JWT signature algorithm we will be using to sign the token
          long startTime = System.currentTimeMillis();
          LOGGER.info("createJWT id=" + id + ";issuer=" + ";subject=" + subject);
          SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS512;
  
          long nowMillis = System.currentTimeMillis();
          Date now = new Date(nowMillis);
  
          //We will sign our JWT with our ApiKey secret
          byte[] apiKeySecretBytes = DatatypeConverter.parseBase64Binary(ApiSecretKey.getSecretKey());
          Key signingKey = new SecretKeySpec(apiKeySecretBytes, signatureAlgorithm.getJcaName());
  
          //Let's set the JWT Claims
          JwtBuilder builder = Jwts.builder().setId(id).setIssuedAt(now).setSubject(subject)
                  .setIssuer(issuer);
          if (!CheckObjectUtils.isNullOrEmpty(authories)) {
              builder.claim(AUTHORITIES_KEY, authories);
          }
          if (!CheckObjectUtils.isNullOrEmpty(loginUserData)) {
              builder.claim(LOGIN_USER_DATA_KEY, loginUserData);
          }
  
          builder.signWith(signatureAlgorithm, signingKey);
  
          //if it has been specified, let's add the expiration
          if (ttlMillis &gt;= 0) {
              long expMillis = nowMillis + ttlMillis;
              Date exp = new Date(expMillis);
              builder.setExpiration(exp);
          }
          LOGGER.info("createJWT process id=" + id + ";issuer=" + ";subject=" + subject + ";time(ms)="
                  + (System.currentTimeMillis() - startTime));
          //Builds the JWT and serializes it to a compact, URL-safe string        
          String token = builder.compact();
          LOGGER.info("createJWT end id=" + id + ";issuer=" + ";subject=" + subject + ";time(ms)="
                  + (System.currentTimeMillis() - startTime));
          return token;
      }
  
  JsonWebTokenRestApi&lt;Long&gt; jwtApi = new JsonWebTokenRestApiFactory(
                  JsonWebTokenRestApiFactory.JWT_JJWT).getJsonWebTokenByType();
          String jwt = jwtApi.createJWT(null, null, "vinhhc_vsc", null, null, 18000);
  </code></pre>
  
  <p>My console log:</p>
  
  <pre><code>createJWT id=null;issuer=;subject=vinhhc_vsc
  createJWT process id=null;issuer=;subject=vinhhc_vsc;time(ms)=151
  createJWT end id=null;issuer=;subject=vinhhc_vsc;time(ms)=664
  </code></pre>
  
  <p>Thanks!</p>