# When to go async

**URL:** <https://ziggit.dev/t/when-to-go-async/18631>\
**Category:** Explain\
**Created:** [November 29, 2026, 11:39am UTC](https://ziggit.dev/t/when-to-go-async/18631 "2026-11-29T11:39:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SuXYIO](https://ziggit.dev/user_avatar/ziggit.dev/suxyio/32/10366_2.png) [@SuXYIO](https://ziggit.dev/u/SuXYIO)\
**Post date:** [November 29, 2026, 11:39am UTC](https://ziggit.dev/t/when-to-go-async/18631/1 "2026-11-29T11:39:55Z")

</div>

I’m building a graphics lib, and when splitting the screen in four quadrants and drawing equation separately, [I got about 3 times improvement](https://ziggit.dev/t/zaggle-optimizing-mandelbrot/18142/).  
But when splitting the task of drawing triangles in two, it almost decreased performance by a magnitude!

So the question is, when to use threading / async, depending on the problem size (compute time).

This is more of a generic programming problem, not unique to zig, but posting here anyway.

Also, why’s async (`std.Io.Group.async`) a little bit slower than threading (`std.Thread`)?

---

<div class="post-metadata">

**Author:** ![vulpesx](https://ziggit.dev/user_avatar/ziggit.dev/vulpesx/32/3989_2.png) [@vulpesx](https://ziggit.dev/u/vulpesx)\
**Post date:** [November 29, 2026, 12:34pm UTC](https://ziggit.dev/t/when-to-go-async/18631/2 "2026-11-29T12:34:25Z")

</div>

In addition to going through the Io vtable, the async model just requires more bookkeeping even if using the `Threaded` runtime which just dispatches to a thread pool.

---

<div class="post-metadata">

**Author:** ![WeeBull](https://ziggit.dev/user_avatar/ziggit.dev/weebull/32/6828_2.png) [@WeeBull](https://ziggit.dev/u/WeeBull)\
**Post date:** [November 29, 2026, 5:09pm UTC](https://ziggit.dev/t/when-to-go-async/18631/3 "2026-11-29T17:09:23Z")

</div>

My guess as to what’s happening is that your two tasks exhibit no concurrency, and so they are done sequentially. That then means you’re in a situation where the async overhead is only working against you.

I haven’t looked at your code but if you’re going multi threaded, but using OpenGL / Vulkan to draw your triangles there will likely be shared resources downstreme with locks around them.
