You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bottleneck is upstream NSGo v0.3.0 Apple CoreGraphics Canvas.DrawAtlas (Go game code takes only 0.32 ms/frame)
iOS
iPhone 17 (iPhone18,3, release -fps)
120 Hz
~12.5 fps (sprites=1012, sustained over 30s)
Same upstream NSGo v0.3.0 Apple CoreGraphics Canvas.DrawAtlas bottleneck
Linux
AMD Ryzen 9 3900X + Radeon RX 6800/6900 XT
2560×1440
Binary launches cleanly; remote monitor asleep (needs interactive unlocked display for live --nsgo-fps)
Windows
Intel Core i5-14600KF (win-runner)
VM (Microsoft Basic Display Adapter)
Binary deployed; needs physical/GPU-attached interactive desktop for real --nsgo-fps
Keeping #64 open because macOS and iOS currently fall short of display rate / 60 fps due to NSGo v0.3.0's Apple CoreGraphics Canvas.DrawAtlas backend (while Android Pixel 3 XL already holds 59–60 fps with identical zero-alloc Go code).
Update on the macOS / iOS Apple Canvas.DrawAtlas bottleneck:
Upstream fix merged: perf(apple): batch Canvas.DrawAtlas compositing in pure Go nsgo#2525 replaces Apple's per-sprite CGContextSetAlpha + CGContextDrawImage loop in Canvas.DrawAtlas with a two-tier pure-Go premultiplied blitter (direct CGBitmapContext write for Tier 1; single-blit tight-bounds scratch bitmap for live CALayer display-list contexts with ≥64 sprites for Tier 2).
1,000-sprite 2560×1440 Retina unit benchmark: 8.26 ms / 7,050 allocs → 0.86 ms (Linear) / 0.46 ms (Nearest) (Tier 1) and 2.34 ms (Tier 2).
Live Apple M4 Pro (120 Hz ProMotion) verification (go tool nsgo test -target macos -activate -fps, 960×540@2x, SPRITES 1012 swarm on):
Baseline nsgo v0.3.4: 29–30 fps
nsgo main + Canvas.ResolutionScale: 1/3 (Sampling: core.ImageSamplingNearest) only: 79–89 fps
NSGo cuts a release containing Canvas.ResolutionScale (nsgo-dev/nsgo@b78d869f3) and perf(apple): batch Canvas.DrawAtlas compositing in pure Go nsgo#2525 so examples/caverun can bump its tagged nsgo dependency and enable ResolutionScale + Sampling: core.ImageSamplingNearest,
iOS is re-measured on a physical iPhone (60 fps target), and
Windows and Linux are measured on physical GPU-attached interactive displays.
Activity
houko commentedon Nov 25, 2026
Measured
examples/caverunwith the 1000-firefly stress swarm enabled (SPRITES 1012, singleDrawAtlas) on physical devices:--nsgo-fps)0%dropped, frame0.24–0.35 ms,60 commits/s)0%dropped,app 0.65 ms,core 0.35 ms, engine21%)SPRITES 1012APP 0.24 ms,CORE 0.08 ms, engine1%;TICK 42.13 ms,CPU 103%,GPU 70%,MEMgrew232→351 MB)Canvas.DrawAtlas(Go game code takes only0.32 ms/frame)iPhone18,3, release-fps)sprites=1012, sustained over 30s)Canvas.DrawAtlasbottleneck--nsgo-fps)win-runner)Microsoft Basic Display Adapter)--nsgo-fpsKeeping #64 open because macOS and iOS currently fall short of display rate / 60 fps due to NSGo v0.3.0's Apple CoreGraphics
Canvas.DrawAtlasbackend (while Android Pixel 3 XL already holds 59–60 fps with identical zero-alloc Go code).houko commentedon Nov 27, 2026
Update on the macOS / iOS Apple
Canvas.DrawAtlasbottleneck:CGContextSetAlpha+CGContextDrawImageloop inCanvas.DrawAtlaswith a two-tier pure-Go premultiplied blitter (directCGBitmapContextwrite for Tier 1; single-blit tight-bounds scratch bitmap for liveCALayerdisplay-list contexts with ≥64 sprites for Tier 2).go tool nsgo test -target macos -activate -fps, 960×540@2x,SPRITES 1012swarm on):nsgo v0.3.4: 29–30 fpsnsgo main+Canvas.ResolutionScale: 1/3(Sampling: core.ImageSamplingNearest) only: 79–89 fpsnsgo main+Canvas.ResolutionScale: 1/3+ perf(apple): batch Canvas.DrawAtlas compositing in pure Go nsgo#2525: 119–120 fps (0%dropped, 120 commits/s, 6.06 ms latency)Keeping #64 (and parent #8) open until:
Canvas.ResolutionScale(nsgo-dev/nsgo@b78d869f3) and perf(apple): batch Canvas.DrawAtlas compositing in pure Go nsgo#2525 soexamples/caveruncan bump its taggednsgodependency and enableResolutionScale+Sampling: core.ImageSamplingNearest,