From a17359716b7a14bb58c31bc029c34c84416cc867 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Sat, 4 Sep 2010 02:41:09 +0000 Subject: [PATCH] Update performance numbers using production flags. --- README.html | 12 ++++++------ build-perf.xml | 5 ++--- src/jse/lua.java | 21 +++++++++++++++------ 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/README.html b/README.html index f1e4a3fb..f038e78b 100644 --- a/README.html +++ b/README.html @@ -120,13 +120,13 @@ in comparison with the standard C distribution. - (interpreted) - 18.355 - 33.953 - 48.088 - 18.339 + -n (interpreted) + 12.838 + 23.290 + 36.894 + 15.163 - java -cp luaj-jse-2.0.jar lua fannkuch.lua 10 + java -cp luaj-jse-2.0.jar lua -n fannkuch.lua 10 lua 5.1.4 diff --git a/build-perf.xml b/build-perf.xml index 39466737..62d6b9e7 100644 --- a/build-perf.xml +++ b/build-perf.xml @@ -30,7 +30,7 @@ dest="lib/mochalua-1.0.jar"/> - + @@ -52,8 +52,7 @@ =========== @{luaprog} ============= - - + diff --git a/src/jse/lua.java b/src/jse/lua.java index 056c2d86..cbee49b2 100644 --- a/src/jse/lua.java +++ b/src/jse/lua.java @@ -26,6 +26,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.util.Vector; import org.luaj.vm2.LoadState; import org.luaj.vm2.Lua; @@ -70,6 +71,9 @@ public class lua { boolean versioninfo = false; boolean processing = true; boolean nodebug = false; + boolean luajc = false; + boolean lua2java = false; + Vector libs = null; try { // stateful argument processing for ( int i=0; i= args.length ) usageExit(); - loadLibrary( args[i] ); + libs = libs!=null? libs: new Vector(); + libs.addElement( args[i] ); break; case 'i': interactive = true; @@ -118,13 +123,17 @@ public class lua { } } - // new lua state - _G = nodebug? JsePlatform.standardGlobals(): JsePlatform.debugGlobals(); - // echo version if ( versioninfo ) System.out.println(version); + // new lua state + _G = nodebug? JsePlatform.standardGlobals(): JsePlatform.debugGlobals(); + if ( luajc ) LuaJC.install(); + if ( lua2java) Lua2Java.install(); + for ( int i=0, n=libs!=null? libs.size(): 0; i