makepad-2.0-performance
makepad performance, makepad debug, makepad profiling, makepad gc, new_batch, texture_caching, render optimization, draw batching, mod.gc, garbage collection, memory, debug logging, troubleshoot, ViewOptimize, PortalList, CachedView, render tree, invisible text, text disappears, UI freezes, scroll stuttering, 性能, 调试, 优化, 垃圾回收, 渲染, 批处理, 日志
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-performance --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Helps optimize Makepad 2.0 UI performance and debugging by teaching how draw batching, garbage collection, render triggers, texture caching, and related features interact. It covers scenarios where text may disappear, background overlaps, and render ordering, and provides guidance on when to use features like new_batch, texture_caching, and PortalList.
How it works
Describes the interplay between draw batching (same shader grouping into a batch), the new_batch: true flag to control draw order, and the potential for text to render behind backgrounds. Explains texture_caching to render sub-trees to an offscreen texture and reuse it when unchanged. Details the Splash VM mark-sweep GC with per-type thresholds and automated triggering rules, plus script API commands mod.gc.run(), mod.gc.run_status(), mod.gc.set_static(value), and mod.gc.dump_tag(value). Outlines the render model using on_render and .render(), emphasizing that rendering is pull-based and only executes when render is invoked on a view, and that re-render should be minimized to only affected sub-trees. Provides practical patterns for static vs dynamic content and periodic GC. Includes best practices for GC marking of large static UI trees and for dynamic lists with automatic cleanup.
When to use it
Triggers on: makepad performance, makepad debug, makepad profiling, makepad gc, new_batch, texture_caching, render optimization, draw batching, mod.gc, garbage collection, memory, debug logging, troubleshoot, ViewOptimize, PortalList, CachedView, render tree, invisible text, text disappears, UI freezes, scroll stuttering, 性能, 调试, 优化, 垃圾回收, 渲染, 批处理, 日志. Use in scenarios where text renders behind backgrounds, text disappears on hover, UI freezes from excessive renders, memory growth concerns, or when diagnosing render ordering and batching issues.
What it can touch
The skill references tools and APIs like new_batch, texture_caching, PortalList, CachedView, on_render, .render(), and the GC APIs: mod.gc.run(), mod.gc.run_status(), mod.gc.set_static(value), mod.gc.dump_tag(value). It discusses how these touch the render tree, drawing batches, and memory management.
Caveats
Covers misordering risks with batched draws and the need to place new_batch: true appropriately. Notes precedence rules where texture_caching takes priority over new_batch. Mentions the GC thresholds and static objects behavior, emphasizing that static objects are never collected and can improve GC traversal speed. No promises of outcomes beyond what is stated.
# Makepad 2.0 Performance & Debugging Skill ## 1. Overview Makepad 2.0 uses a unique rendering pipeline combined with the Splash script VM. Performance depends on understanding three critical subsystems: 1. **Draw Batching** - How Makepad groups GPU draw calls and why `new_batch: true` matters 2. **Garbage Collection** - The Splash VM's mark-sweep GC with per-type-bucket thresholds 3. **Render Triggers** - The `on_render` / `.render()` system that controls when sub-trees rebuild Unlike traditional retained-mode UI frameworks, Makepad uses an immediate-mode-inspired draw pipeline where widgets emit draw commands into a sorted batch list. Understanding this pipeline is essential for diagnosing invisible text, flickering, and performance regressions. --- ## 2. Draw Batching System ### How It Works Makepad automatically batches consecutive draw calls that use the **same shader** into a single GPU draw call. This is a major performance optimization, but it has a critical side effect: draw order can be surprising. ``` Draw pipeline (simplified): Widget tree: GPU batches (default): View (bg shader) Batch 1: all bg shaders Label (text) --> Batch 2: all text shaders View (bg shader) Label (
- 1. Overview
- 2. Draw Batching System
- How It Works
- newbatch: true
- When newbatch: true Is Required
- Hover Effects and newbatch
- ViewOptimize Internals
- 3. Texture Caching
- Pre-Built Cached Views
- When to Use Texture Caching
- Trade-offs
- 4. Garbage Collection (mod.gc)
- Architecture
- Automatic GC Triggering
cargo run -p cargo-makepad --release -- studio --studio=127.0.0.1:8001
What does the makepad-2.0-performance skill do?
makepad performance, makepad debug, makepad profiling, makepad gc, new_batch, texture_caching, render optimization, draw batching, mod.gc, garbage collection, memory, debug logging, troubleshoot, ViewOptimize, PortalList, CachedView, render tree, invisible text, text disappears, UI freezes, scroll stuttering, 性能, 调试, 优化, 垃圾回收, 渲染, 批处理, 日志
How do I install it?
Run `npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-performance --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ZhangHanDong/makepad-skills, a repository with 745 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
