# Simple state protection via Actor vs DispatchQueue.sync?

**URL:** <https://forums.swift.org/t/simple-state-protection-via-actor-vs-dispatchqueue-sync/66184>\
**Category:** Using Swift\
**Tags:** actors, threadsafe\
**Created:** [July 16, 2023, 6:29pm UTC](https://forums.swift.org/t/simple-state-protection-via-actor-vs-dispatchqueue-sync/66184 "2023-07-16T18:29:02Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![David\_Smith](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/david_smith/32/37508_2.png) [@David\_Smith](https://forums.swift.org/u/David_Smith)\
**Post date:** [July 17, 2023, 1:38am UTC](https://forums.swift.org/t/simple-state-protection-via-actor-vs-dispatchqueue-sync/66184/7 "2023-07-17T01:38:22Z")

</div>

Not terribly surprising, really. The actor version is asynchronous, so it’s doing much more work than the queue version. Last time I measured, actor calls were roughly in the middle between DispatchQueue.sync and async, but I was only testing one specific scenario and it was about a year ago, so I wouldn’t extrapolate too much from that.

---

_[View the full topic](https://forums.swift.org/t/simple-state-protection-via-actor-vs-dispatchqueue-sync/66184)._
