title: What are the benefits of using DispatchWorkItem in swift?
body: <p>Suppose we have the following code defining a continuous loop (as in for a game):</p>
  
  <pre><code>let queue = DispatchQueue(label: "DemoSerialQueue")
  let workItem = DispatchWorkItem{ print("Hello World") }
  func gameLoop() {
    queue.async(execute:workItem)
  }
  </code></pre>
  
  <p>Would the above code be more efficient in terms of speed than the following:</p>
  
  <pre><code>func gameLoop() {
    queue.async{ print("Hello World") }
  }
  </code></pre>
  
  <p>In particular I'm wondering if the second form would be allocating a closure on every loop and thus incuring a performance hit.</p>