Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Polynominal/Piefiller
Graphical profiler for Love2D 9.2
https://github.com/Polynominal/Piefiller
Last synced: 3 days ago
JSON representation
Graphical profiler for Love2D 9.2
- Host: GitHub
- URL: https://github.com/Polynominal/Piefiller
- Owner: Polynominal
- License: mit
- Created: 2015-11-07T11:18:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-01T08:43:09.000Z (over 7 years ago)
- Last Synced: 2024-08-02T06:19:28.111Z (3 months ago)
- Language: Lua
- Size: 9.77 KB
- Stars: 23
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-love2d - Piefiller - Graphical profiler for LÖVE. (Performance)
README
# Piefiller
Graphical profiler for Love2D 0.10.2
# Usage
1) require the file:
```lua
piefiller = require("piefiller")
```
2) make a new instance of piefiller
```lua
Pie = piefiller:new()
```
3) attach the piefiller to the part of your application that you want to monitor, it can be whatever but I suggest calling it in love.update or love.draw as this is what piefiller is all about.```lua
function love.update()
Pie:attach()
-- do something
Pie:detach()
end
```
4) draw the output in your draw function and give event hooks for your pie.
```lua
function love.draw()
Pie:draw()
end
function love.keypressed(...)
Pie:keypressed(...)
end
function love.mousepressed(...)
Pie:mousepressed(...)
end
```
5) When you get sufficient output press the "P" key to output to file.
# Keys
r = resets the pieup = decreases depth
down = increases depth
, = decreases step size
. = increases step size
s = shortens the names displayed
c = hides/shows hidden processes
p = saves to file called "Profile" and opens directory for you
## To redefine these:
Modes available:
```lua
reset
increase_depth
decrease_depth
increase_step_size
decrease_step_size
shorten_names
show_hidden
save_to_file
```
To redefine only one of the keys:```lua
piefiller:setKey(mode,key)
```example:
```lua
piefiller:setKey("increase_depth","up")
```
To redefine all of the keys:
```lua
table = {
"increase_depth" = "up"
}
piefiller:setKey(table)
```
# For your own interpretation
If you wish to interpret the data on your own use piefiller:unpack().
Output is a table as such:
```lua
data = {
items = {
{
name,
line_defined,
current_line,
source,
time_taken,
percentage,
caller,
}
},
about = {
depth,
step,
totalTime,
},
}
```
# Additional notes
The best depth to search for is 2 and 3.When used in large applications the output is difficult to read, however printing to file resolves this issue.
# Planned features
Make sure that text does not overlay.