Created
November 4, 2012 19:01
-
-
Save okram/4013090 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testStartupCosts() throws Exception { | |
final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(); | |
CompiledScript script1 = engine.compile(""); | |
CompiledScript script2 = engine.compile("1+1"); | |
int runs = 750; | |
long totalTime = 0l; | |
for (int i = 0; i < runs; i++) { | |
long time = System.currentTimeMillis(); | |
//engine.eval(""); | |
script1.eval(); | |
totalTime += System.currentTimeMillis() - time; | |
} | |
System.out.println(totalTime); | |
totalTime = 0l; | |
for (int i = 0; i < runs; i++) { | |
long time = System.currentTimeMillis(); | |
//engine.eval("1+1"); | |
script2.eval(); | |
totalTime += System.currentTimeMillis() - time; | |
} | |
System.out.println(totalTime); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment