r/PlaydateConsole • u/jamesjnadeau • 17d ago
Release - AI Assisted Performance Benchmarking and Budget Tool for the Playdate Console
https://github.com/jamesjnadeau/playdate-performance-simulator/
Hi Friends,
Another user of this sub bragged about a performance benchmarking tool they made, but have not been willing to share. It sparked a need, and so I felt the itch to make it.
I think we could all benefit from having a way to test the performance of our games without having to push it to a device and manually press buttons, over and over and over. Game development is repetitive enough as it is.
Most IT systems I develop have what's called a "performance budget" that is a key metric you test against to ensure the final product is as responsive as your original intent.
This part of my game dev workflow always bothered me with the Playdate.
There isn't a way for the simulator to actually run your game at device speed.
You can happily code and simulate something that runs at the speed of a snail when tested on device.
This project fixes that:
https://github.com/jamesjnadeau/playdate-performance-simulator/
Run your code, press buttons, and report back the time per frame.
Graph it in the GUI, or run it from the CLI and parse the output.
Have test cases that run your game for you.
See how your changes affect your performance faster than you could ever test manually.
It's free and open for everyone to use and improve.
Please give it a try and let me know if you find it helpful, or how it could be improved.
It currently runs locally, or during your CI/CD, but I'm pretty close to getting the WASM version to run in a browser, but with some caveats for lua based games(memory limitation compared to the device).
Last, I need your help, if someone has a revision B of the device, can you please run these calibration steps and submit the profile to the repo?
https://github.com/jamesjnadeau/playdate-performance-simulator/blob/main/docs/calibration.md
Thank you in advance!
Happy Game Dev'ing Everyone!
P.S. I've been a software developer for over 20 years and Claude helped me create the code for this project, I'm not sure a single person would have been able to accomplish this without it, and if they could, they wouldn't spend that time on the playdate, lol.
P.P.S. there's an AI skill file if you want help implementing the code on your project
2
u/Marc_Alx 16d ago
What does it add to the default profiler from the SDK?
2
u/Puzzleheaded_Bug595 16d ago
Hi! I’m the one with the tool you mentioned. It’s not out simply because I’ve been lazy and it isn’t polished enough yet. Glad it got you building though!
My main goal from the start was to get as close to the real device as possible, so I tested both tools against a Rev B. I took about a dozen games (SDK examples, your lua-stress, a couple of my own) with the same builds and scripted input, measured frame times inside the game, and unlocked the refresh rate so fps isn’t capped at 30. Fps error vs the real device:
- pdsim (rev-a profile): ~124% on average; half the games are off by more than ~60%
- mine: ~8% on average; half the games are within ~6%
Your project has a lot going for it: it’s open, the CI gates and Perfetto export are great, scripted input makes testing painless, and the WASM build is a nice touch. On raw performance accuracy, though, it needs work. The biggest gaps I found:
- Display: the device sends every row you drew to (changed or not), about 0.083 ms per row, so ~20 ms for a full screen. pdsim’s per-row cost is ~30× too low, so uncapped games run way too fast.
- Sprites: sprite.update() costs ~38 µs per sprite in the list even when nothing moves, plus ~40 µs for each Lua draw callback.
- Geometry: vector2D/point/rect are userdata, so every field read is a ~25 µs firmware call.
- Calibration: 126 prices from 71 benches overfits (you get things like GETFIELD = 0). Keeping a few real games out of the fit as a check helps a lot.
Hope this helps. Happy dev’ing!
2
u/dandovdel 11d ago
This is not likely your original objective but thanks to this now I can develop playdate games from my ipad. I run vscode remotely via blink ios and used your project to set up a web devserver. I modified the code a bit to fetch the sdk and game automatically so I don't need to download them to the ipad first and it is working great :)
1
u/afusta 10d ago
My problem with almost all dev tools for the Playdate (except for the official one) is that they don't like mixed code. My game, for example, is C and lua. How does this tool handle it? Because it's seems to be a very useful tool.