title: Quickest way to render a Uint8Array to a Canvas
body: <p>I am receiving a <code>Uint8Array</code> with RGBA values, as well as some information which part of the image has been updated. What is the quickest way to render this raw bitmap information back to a canvas? I have been using a 2D rendering context to manually loop though the array and set pixel information, but this is incredibly slow:</p>
  
  <pre><code>let imageData = new ImageData(1920, 1080);
  for (var i=0;i &lt; args.frameBuffer.length; i+=4) {
      imageData.data[i]   = args.frameBuffer[i];
      imageData.data[i+1] = args.frameBuffer[i+1];
      imageData.data[i+2] = args.frameBuffer[i+2];
      imageData.data[i+3] = args.frameBuffer[i+3];
  }
  context.putImageData(imageData, 0, 0, args.dirtyX, args.dirtyY, args.dirtyWidth, args.dirtyHeight);
  </code></pre>
  
  <p>What would be a more efficient way to do this? Would WebGL be more performant than a 2D context? Native or via something like Three.js?</p>