on android, in luajava, fib(32) test, the luajit2.1 is OK!
I add this function in lj_buf.h
static LJ_AINLINE void _BUF_G_narrow(lua_State *L, MSize l ) {
if(0xffff< l ) {
global_State *g = G(L);
lj_buf_free(g, &g->tmpbuf );
lj_buf_init(L, &g->tmpbuf );
}
}
and in lib_string.h string_rep function
after setstrV(...)
add _BUF_G_narrow(L, sbufsz(sb ) );
if string_rep build a large string (> 64K ), narrow g->tmpbuf
before change, in lua,
str1=string.rep("0", 0x1000000 ) have 32M memory
after change have 16M memory
在 2015-09-11 19:47:42,"\"Vyacheslav Egorov\" <dmarc-noreply@xxxxxxxxxxxxx>
(Redacted sender \"vegorov@xxxxxxxxxx\" for" <DMARC)> 写道:
Unfortunately you are not providing enough information to really help you with
this issue, especially given that your execution environments are to a certain
degree exotic.
For slowness issue try compiling and using perf on the binary - to see what's
actually going on inside.
For segmentation fault - you need to at least provide backtrace and, if fault
occurred in the JITed or vm code - disassembly around the instruction pointer.
FWIW I crosscompiled LJ 2.1 branch for Android 4.4 and run binary on Nexus 4
(which is unfortunately the only ARM device I have readily available on my desk
atm) - and I could neither reproduce the crash nor slowness.
On Thu, Sep 10, 2015 at 9:10 AM zzz654321 <zzz654321@xxxxxxx> wrote:
local function fib(n )
if n < 3 then return n - 1 end
return fib(n - 2) + fib(n - 1)
end
local t1= os.clock() local t2= fib(32 ) t1=os.clock()- t1
on android, the code is very slow, please check the bug.
2.0.4 the code vs lua5.1.5 ### 100:1 ###
mt6592 lj2.0.4 13s lua5.1.5 0.13s
on android 2.1.0 compiler OK,
but run ERROR, "Segmentation fault."
--
// Vyacheslav Egorov