time - Groovy code gets faster and slower when using "@CompileStatic" -


i have following snipet of groovy code

class test  { //  @groovy.transform.compilestatic     static main(args)      {         long start = system.currenttimemillis()         def x = "3967"         println x ==~ /[0-9]+([1379])$/         println system.currenttimemillis()-start     } } 

which supposed test weather x number ending in 1,3,7,or 9

i'm using groovy plugin eclipse, when want run code have few options, can either run groovy script, or java application. here runtimes.

groovy script: 93ms java application: 125ms 

but when enable static compilation, happens

groovy script: 0ms java application: 312ms  

i'm confused,
1. thought compiling java application supposed faster running groovy script.
2. why groovy script option gets faster static compilation, , java 1 gets longer?


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -