--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
问题原因:经调查,问题原因,在string.sub中,需要调用luajit中lj_str.c中的lj_str_new函数,该函数对字符串的创建采用了合并机制,在查找已存在串时,在上述场景中出现n级别循环,从而导致,string.sub操作,从n级别,升级至n平方级别,严重影响性能。
请问,有没有已知方法可以规避该问题,或者,必须在luajit中做修改?
订阅: 请发空白邮件到 openresty+subs...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsub...@googlegroups.com
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subs...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsub...@googlegroups.com
请问所说的PR [1] 链接在哪?
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
非常感谢,查了下,tcp.send 一个 table时,会调用 ngx_http_lua_socket_tcp_send 函数,检测到参数为 LUA_TTABLE 类型时,再调用 ngx_http_lua_copy_str_in_table 将table转为字符串。总结来说,就是要写个c接口,传入table,返回string。 效果还需验证。
------------------ 原始邮件 ------------------
发件人: "DeJiang Zhu";<douji...@gmail.com>;发送时间: 2016年12月13日(星期二) 下午2:44
收件人: "openresty"<openresty@googlegroups.com>;主题: Re: [openresty] luajit在处理某些字符串场景时出现性能问题