"profile.lua" a tool for finding bottlenecks
Re: "profile.lua" a tool for finding bottlenecks
Thanks, very useful library, easier to use than others I found. I've added it to the list of Libraries in the Wiki: https://love2d.org/wiki/profile
Re: "profile.lua" a tool for finding bottlenecks
This profiling tool is fantastic. Thanks Ivan!
Would it be technically possible to make the profiling hierarchical? That is, if a function bar is called inside a function foo, it would be displayed as:
Would it be technically possible to make the profiling hierarchical? That is, if a function bar is called inside a function foo, it would be displayed as:
Code: Select all
Function Calls Time
/foo 1 5.0
/foo/bar 2 3.2
/foo/baz 1 1.5
Re: "profile.lua" a tool for finding bottlenecks
Thanks Przemator.
It's certainly possible, but I'm not sure if it would be more useful.
Consider the following example:
The "bar" function took 4.7 seconds of overall execution time but based on your suggestion
"bar" would be displayed as 2 different entries in the report ("foo/bar" and "baz/bar").
What if you have recursion with foo calling itself multiple times?
Cheers!
It's certainly possible, but I'm not sure if it would be more useful.
Consider the following example:
Code: Select all
Function Calls Time
/foo 1 3.3
/foo/bar 2 3.2
/baz 1 1.6
/baz/bar 2 1.5
"bar" would be displayed as 2 different entries in the report ("foo/bar" and "baz/bar").
What if you have recursion with foo calling itself multiple times?
Code: Select all
foo
foo/foo
foo/foo/foo
Re: "profile.lua" a tool for finding bottlenecks
I work with Oracle, and the software I use generates really cool clickable SVG flame graphs.
You're right, that it's useful to know the total elapsed time for a function, but it also helps to know which functions have been calling it. Don't know how the flame graph handles recurrence.
You're right, that it's useful to know the total elapsed time for a function, but it also helps to know which functions have been calling it. Don't know how the flame graph handles recurrence.
Re: "profile.lua" a tool for finding bottlenecks
By the way, regarding the memory issue. The way it’s solved on the Oracle database I work with is following. First the profiling data is dumped into a file, which just keeps growing. It can easily get to 2 GB in just a few minutes. Then I supply this file into a report generator, which either creates a HTML report or a SVG graph.
Re: "profile.lua" a tool for finding bottlenecks
Looks cool, somebody already managed to hookup Lua with KCacheGrind so it's definitely possible to produce more sophisticated visualizations/reports. Personally, I don't really need that sort of thing for now, but you are free to modify the code, and use it any way you like. Cheers!
Re: "profile.lua" a tool for finding bottlenecks
Found a few problems with the profiler under LuaJIT (JIT doesn't trigger the "return" event when recursion is involved).
I have just released a patch to account for that, but it's not perfect. Note that C-functions are not supported at all.
https://github.com/2dengine/profile.lua
Use at your own risk!
I have just released a patch to account for that, but it's not perfect. Note that C-functions are not supported at all.
https://github.com/2dengine/profile.lua
Use at your own risk!
Last edited by ivan on Sat Dec 11, 2021 8:22 am, edited 2 times in total.
Re: "profile.lua" a tool for finding bottlenecks
Just pushed a major update that verifies that the profiler works correctly with Love2D 11.3/LuaJIT 2.0.5 and Lua 5.3.
Please update your profile.lua if you are using this lib!
Please update your profile.lua if you are using this lib!
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests