diff options
Diffstat (limited to 'LuaSL')
-rwxr-xr-x | LuaSL/luaprocTest.sh | 14 | ||||
-rw-r--r-- | LuaSL/src/LuaSL_main.c | 33 |
2 files changed, 32 insertions, 15 deletions
diff --git a/LuaSL/luaprocTest.sh b/LuaSL/luaprocTest.sh deleted file mode 100755 index 98f37f5..0000000 --- a/LuaSL/luaprocTest.sh +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #! /bin/bash | ||
2 | |||
3 | cd testLua | ||
4 | |||
5 | LUA_SOPATH="../../libraries/luaproc/" lua luaprocTest0.lua | ||
6 | |||
7 | time LUA_SOPATH="../../libraries/luaproc/" lua luaprocTest1.lua | ||
8 | |||
9 | time LUA_SOPATH="../../libraries/luaproc/" luajit luaprocTest1.lua | ||
10 | |||
11 | time LUA_SOPATH="../../libraries/luaproc/" lua luaprocTest2.lua | ||
12 | |||
13 | time LUA_SOPATH="../../libraries/luaproc/" luajit luaprocTest2.lua | ||
14 | |||
diff --git a/LuaSL/src/LuaSL_main.c b/LuaSL/src/LuaSL_main.c index efa3d43..3f20460 100644 --- a/LuaSL/src/LuaSL_main.c +++ b/LuaSL/src/LuaSL_main.c | |||
@@ -1,6 +1,6 @@ | |||
1 | #include "LuaSL.h" | 1 | #include "LuaSL.h" |
2 | 2 | ||
3 | #define LUA_TEST 0 | 3 | #define LUA_TEST 1 |
4 | 4 | ||
5 | static int scriptCount; | 5 | static int scriptCount; |
6 | 6 | ||
@@ -264,6 +264,37 @@ main(int argc, char **argv) | |||
264 | printf("Compiling %d Lua scripts took %f seconds, that's %f scripts per second.\n\n", scriptCount, diff, scriptCount / diff); | 264 | printf("Compiling %d Lua scripts took %f seconds, that's %f scripts per second.\n\n", scriptCount, diff, scriptCount / diff); |
265 | 265 | ||
266 | printf("Combined estimate of compiling speed is %f scripts per second.\n", 1 / ((diff0 / lslCount) + (diff / scriptCount))); | 266 | printf("Combined estimate of compiling speed is %f scripts per second.\n", 1 / ((diff0 / lslCount) + (diff / scriptCount))); |
267 | |||
268 | gettimeofday(&lastTime2, 0); | ||
269 | snprintf(buf, sizeof(buf), "cd %s/testLua; LUA_SOPATH='../../libraries/luaproc/' lua luaprocTest0.lua", PACKAGE_DATA_DIR); | ||
270 | system(buf); | ||
271 | diff = timeDiff(&thisTime2, &lastTime2); | ||
272 | printf("%s TOOK %f seconds.\n", buf, diff); | ||
273 | |||
274 | gettimeofday(&lastTime2, 0); | ||
275 | snprintf(buf, sizeof(buf), "cd %s/testLua; LUA_SOPATH='../../libraries/luaproc/' lua luaprocTest1.lua", PACKAGE_DATA_DIR); | ||
276 | system(buf); | ||
277 | diff = timeDiff(&thisTime2, &lastTime2); | ||
278 | printf("%s TOOK %f seconds.\n", buf, diff); | ||
279 | |||
280 | gettimeofday(&lastTime2, 0); | ||
281 | snprintf(buf, sizeof(buf), "cd %s/testLua; LUA_SOPATH='../../libraries/luaproc/' luajit luaprocTest1.lua", PACKAGE_DATA_DIR); | ||
282 | system(buf); | ||
283 | diff = timeDiff(&thisTime2, &lastTime2); | ||
284 | printf("%s TOOK %f seconds.\n", buf, diff); | ||
285 | |||
286 | gettimeofday(&lastTime2, 0); | ||
287 | snprintf(buf, sizeof(buf), "cd %s/testLua; LUA_SOPATH='../../libraries/luaproc/' lua luaprocTest2.lua", PACKAGE_DATA_DIR); | ||
288 | system(buf); | ||
289 | diff = timeDiff(&thisTime2, &lastTime2); | ||
290 | printf("%s TOOK %f seconds.\n", buf, diff); | ||
291 | |||
292 | gettimeofday(&lastTime2, 0); | ||
293 | snprintf(buf, sizeof(buf), "cd %s/testLua; LUA_SOPATH='../../libraries/luaproc/' luajit luaprocTest2.lua", PACKAGE_DATA_DIR); | ||
294 | system(buf); | ||
295 | diff = timeDiff(&thisTime2, &lastTime2); | ||
296 | printf("%s TOOK %f seconds.\n", buf, diff); | ||
297 | |||
267 | #endif | 298 | #endif |
268 | 299 | ||
269 | if (game.ui) | 300 | if (game.ui) |