Comments (5)
On 12/06/2013, at 6:06 AM, pygy [email protected] wrote:
Hello, I get a slew of errors when I try to profile LuLPeg:
https://gist.github.com/pygy/b23ac1c81c6d3fffa387
Luatrace gets lost after 62 milliseconds, and the parsing itself takes 5+ secondson my machine.
Any suggestion?
The first bunch of errors appear do be because you're executing code in a string (I think) and you can probably ignore them. The one that makes it crash, though, is more serious - it means it's lost track of the call stack at some stage. Tail calls and returns make this kind of tracing really difficult. I'm afraid I'm a bit busy at the moment, but I'll put trying luatrace with lulpeg on my todo list.
from luatrace.
How about loadstring()
ed code that returns functions? There are four instances of this in compiler.lua, here's the simplest:
compilers["char"] = function (pt, ccache)
return load(([[
local get_int = ...
return function(subject, index, cap_acc, cap_i, state)
-- dprint("Char ",cap_acc, cap_acc and cap_acc.type or "'nil'", cap_i, index, state) --, subject)
local c, nindex = get_int(subject, index)
if c ~= __C0__ then
return false, index, cap_i
end
return true, nindex, cap_i
end]]):gsub("__C0__", tostring(pt.aux)))(get_int)
end
I know that in all cases, I could use a closure with upvalues instead of what I'm doing now, but I'll have to take the loadstring()
road at some point, so I'm gently transitioning.
I'm also about to introduce tail calls in loadstring()
ed code. I guess it does not bode well for profiling...
If you want to investigate the crash, the code in src
must be run from that directory, while lulpeg.lua
is a packed file that can be put anywhere.
~/tmp/mtytest.lua
local lulpeg = reqiuire(arg[1])
-- test code
then
.../LuLPeg/src$ lua -luatrace.profile ~/tmp/mytest.lua init
or
.../LuLPeg$ lua -luatrace.profile ~/tmp/mytest.lua lulpeg
to build lulpeg.lua
, run ./scripts/make.sh
from the LuLPeg
directory.
from luatrace.
I'll put trying luatrace with lulpeg on my todo list.
Any progress filing down that TODO list?
from luatrace.
On 13/03/2015, at 8:21 am, daurnimator [email protected] wrote:
I'll put trying luatrace with lulpeg on my todo list.
Any progress filing down that TODO list?
I’m afraid I haven’t looked at luatrace in a long time. The problem here is likely misidentification of tail calls or hidden yields or something, and the debug API is not quite precise enough to always get these right. Are you, then, using LuLPeg and suffering from performance problems?
from luatrace.
Are you, then, using LuLPeg and suffering from performance problems?
One part of my application was using lulpeg, while another was having performance problems.
from luatrace.
Related Issues (11)
- make fails on Ubuntu HOT 10
- What should I do when I got this numbers? HOT 1
- Make fail about dirname and -I mssing path
- luatrace is not compatible with strict because unintended global variable
- Please provide a LuaRocks rock for the tool HOT 8
- build on msvc HOT 1
- Intermittent errors HOT 4
- Error compiling git head (db7fb4ef3ad7a544aeab4b2786a905af47fdd409) HOT 4
- How to use for embedded luajit2 HOT 2
- luatrace.profile crashes trying to index a local 'thread' HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luatrace.