TechBuzzPro

AR App Performance Debugging: Step-by-Step Fix Guide

· 6 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To fix performance issues in an augmented reality app, start by measuring where the time actually goes: enable the engine's frame-timing profiler, watch the CPU and GPU frame times, and fix the biggest cost first. Most AR slowdowns come from too many draw calls, oversized textures, real-time shadows and lights, and per-frame allocations, not from the AR tracking itself. Work through the steps below in order, changing one thing at a time and re-measuring after each change. The exact menu names vary by engine version and device, so treat the paths as a guide and look for the closest equivalent in your version.

What You'll Need

  • Your AR project open in its editor (Unity with AR Foundation, Unreal Engine with ARKit/ARCore, or a native ARKit/ARCore project).
  • A physical test device that matches your lowest-spec target, not just a high-end phone.
  • The engine's profiler or the platform's GPU/CPU capture tools installed.
  • A release or development build on the device, since editor performance is not representative.
  • A stopwatch or frame-counter overlay so you can compare before and after.

Step-by-Step

  1. Establish a baseline on the real device. Build a development build, install it on your lowest-spec target phone, and run the same AR scene for at least 60 seconds. Record the average frame time and the worst frame. If you do not have a number to beat, you cannot tell whether a change helped.
  2. Open the frame profiler and read the split. In Unity, use the Profiler window and the Frame Debugger; in Unreal, use the Unreal Insights and the GPU Visualizer. Look at CPU main thread, render thread, and GPU time separately. The largest bar is your first target. If GPU time dominates, you are fill-rate or shader bound; if CPU time dominates, you are likely draw-call or script bound.
  3. Cut draw calls before anything else. Merge static meshes, enable static batching where the engine supports it, and use GPU instancing for repeated objects. Check the Frame Debugger or the render statistics to see how many draw calls each frame issues. A few hundred is normal on mobile; over a thousand in a simple AR scene usually means batching is not working.
  4. Audit textures and materials. Resize textures to the on-screen size they actually appear at, use compressed formats, and disable mipmaps only where they genuinely are not needed. Replace expensive transparent and cutout shaders with opaque ones where possible. Transparent overdraw is one of the most common hidden costs in AR because the camera feed sits behind everything.
  5. Reduce real-time lighting and shadows. Disable real-time shadows on mobile unless they are essential, lower shadow resolution and distance, and bake lighting for static geometry. Each additional real-time light multiplies shader cost. If you need a grounded look, use a simple blob shadow or a baked lightmap instead.
  6. Fix per-frame allocations. In the profiler, check the GC Alloc column in the CPU section. Allocating in Update, instantiating objects every frame, or creating new strings and lists causes garbage collection spikes that show up as stutter. Cache references, reuse objects with a pool, and avoid LINQ and string concatenation in hot paths.
  7. Throttle AR subsystem work. Plane detection, image tracking, and mesh generation are expensive. Lower the detection rate, limit the number of tracked images, and stop updating meshes once the scene is stable. In AR Foundation, adjust the plane detection mode and the tracking mode to what the experience actually needs.
  8. Cap the frame rate and resolution. Set an explicit target frame rate (for example 30 or 60 fps) and enable the platform's adaptive resolution or dynamic resolution scaling if available. Rendering at full device resolution is often unnecessary for AR and costs a lot of GPU time.
  9. Profile the AR camera background. The camera feed is drawn every frame and can be a significant fill cost. Use the platform's recommended background rendering path, avoid extra full-screen effects on top of it, and check that post-processing is not running on the camera texture.
  10. Re-measure and repeat. After each change, rebuild and rerun the same 60-second scene on the same device. Keep a simple table of frame time before and after. Stop when you hit your target frame time with headroom, not when the profiler looks tidy.

Common Mistakes

  • Profiling in the editor instead of on the device. Editor numbers are misleading because the rendering path and hardware differ.
  • Changing several things at once, then not knowing which change helped or hurt.
  • Optimizing shaders before checking draw calls, when batching was the real problem.
  • Leaving the profiler attached during a release build, which itself adds overhead.
  • Ignoring thermal throttling: a phone that runs fine for 30 seconds may drop frames after two minutes of heavy AR work.

Tips

  • Test on the oldest supported device, not the newest. Performance headroom on a flagship hides problems.
  • Use a fixed test scene and a fixed camera path so comparisons are fair.
  • Watch memory as well as frame time; AR apps that grow memory over time will eventually stutter or crash.
  • Keep a simple performance budget per feature (for example, a maximum number of draw calls and lights) and enforce it during review.
  • Check the platform vendor's official performance guidance for ARKit and ARCore, since it lists device-specific limits.

Troubleshooting

If frame time is fine in the profiler but the app still feels choppy, look for garbage collection spikes in the CPU timeline and for input or UI code running every frame. If the device gets hot and slows down after a minute, reduce GPU load first: lower resolution, remove post-processing, and cut transparent overdraw. If tracking itself is jittery, that is usually a lighting or feature-point problem rather than a rendering one; improve lighting and avoid blank walls. If the app crashes rather than slows, check memory usage and texture sizes before chasing frame rate. If a change makes things worse, revert it immediately and re-baseline rather than stacking more changes on top.

Frequently Asked Questions

Why is my AR app slow only on some phones?

Different GPUs and thermal limits handle fill rate and shader complexity very differently. A scene that fits a flagship may exceed a mid-range device's budget, so always profile on your lowest target.

Does AR tracking itself cause most performance problems?

Usually not. Tracking is handled by the platform, and the common bottlenecks are rendering, draw calls, lighting, and per-frame allocations in your own code.

Should I lower the frame rate to improve performance?

It can help, but it changes the feel of the experience. Fix the largest cost first, then cap the frame rate at a level the device can hold consistently.

How do I know if I am GPU bound or CPU bound?

Compare GPU time with CPU main-thread and render-thread time in the profiler. The largest of the three tells you which side to optimize first.

Can I optimize an AR app without a physical device?

Not reliably. Editor and simulator performance do not reflect real hardware, so a test device is effectively required for meaningful measurement.