From 659e5f6bddd9610759cd9e59a58b8f0604248a45 Mon Sep 17 00:00:00 2001 From: chrox Date: Thu, 1 May 2014 11:58:05 +0800 Subject: [PATCH] use buildin LuaJIT profiler --- koreader-base | 2 +- reader.lua | 18 ++++-------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/koreader-base b/koreader-base index c78c2cd4a..362a1c51b 160000 --- a/koreader-base +++ b/koreader-base @@ -1 +1 @@ -Subproject commit c78c2cd4a8824f855a330ff50b631d554f830120 +Subproject commit 362a1c51b186339270733edae3206666c583bfab diff --git a/reader.lua b/reader.lua index 2cb04dfa7..ccc405307 100755 --- a/reader.lua +++ b/reader.lua @@ -26,14 +26,9 @@ local Screen = require("ui/screen") local ReaderUI = require("apps/reader/readerui") -Profiler = nil +local Profiler = nil function exitReader() - if Profiler ~= nil then - Profiler:stop() - Profiler:dump("./profile.html") - end - G_reader_settings:close() input.closeAll() @@ -56,6 +51,7 @@ function exitReader() end end + if Profiler then Profiler.stop() end os.exit(0) end @@ -146,14 +142,8 @@ while argidx <= #ARGV do elseif arg == "-d" then DEBUG:turnOn() elseif arg == "-p" then - local lulip = require("ffi/lulip") - Profiler = lulip:new() - pcall(function() - -- set maxrows only if the optional arg is numeric - Profiler:maxrows(ARGV[argidx] + 0) - argidx = argidx + 1 - end) - Profiler:start() + Profiler = require("jit.p") + Profiler.start("la") else -- not a recognized option, should be a filename argidx = argidx - 1