AppleCake - Love Profiling

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Posts: 38
Joined: Thu Dec 02, 2021 11:38 am

AppleCake - Love Profiling

Post by EngineerSmith »

AppleCake is an extensive profiling library designed to profile multithreaded applications. It uses widely available Chromium's about://tracing for you to visualise the data.

AppleCake is a little over 2 years old now, and I have recently updated it to provide more features and better performance!
Full docs + examples:

  • Profile how long code takes
  • Nested Profiling, so you can get more detailed information where time is spent
  • Multi-threaded profiling support
  • Mark timeless events when they happen
  • Track variables on a bar graph as they change
  • Profile Lua's memory usage in a bar graph
  • Disable for release easily across all threads
  • Recover Crashed data with ease
  • Switch to and from jprof easily, so you can try AppleCake out in your project

Check out the following URL for a full example of all of AppleCakes features ... ample-full.
Basic example

Code: Select all

local appleCake = require("libs.AppleCake")(true) -- setting to false will remove it for the entire project

function love.quit()

function love.load()
	local profile = appleCake.profile("love.load") -- simple profiling for single use functions
	-- ...

local updateProfile
function love.update(dt)
	updateProfile = appleCake.profileFunc({delta=dt}, updateProfile) -- reuse profile table to reduce overhead
	-- appleCake.profileFunc generates the name of the profile for you based on the function's name
	appleCake.countMemory() -- add a bar chart of memory usage

function love.keypressed(_, key)
	appleCake.mark("Keypressed", "p", {key = key}) -- mark timeless events

local counter -- record the change in numeric variables as a bar chart
function love.draw()
	-- ...
	appleCake.counter("Draw calls", {}, counter)
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests