You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2020/08/01 15:51:49 UTC

[GitHub] [groovy] danielsun1106 commented on pull request #1329: GROOVY-9637: Improve the performance of GString (closes #1329)

danielsun1106 commented on pull request #1329:
URL: https://github.com/apache/groovy/pull/1329#issuecomment-667551313


   @blackdrag 
   Yep ;-) About only 290ms costs in the simple benchmark on machine when the PR applied.
   
   ```groovy
   def gstr = makeGString()
   long b = System.currentTimeMillis()
   for (int i = 0; i < 10000000; i++) {
   	gstr.toString()
   }
   long e = System.currentTimeMillis()
   println "${e - b}ms"
   
   //@groovy.transform.CompileStatic
   def makeGString() {
       def now = java.time.LocalDateTime.now()
       "integer: ${1}, double: ${1.2d}, string: ${'x'}, class: ${Map.class}, boolean: ${true}, now: ${now}"
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org