WebGPU: is writeBuffer or mappedAtCreation faster

In babylon.js, buffers are passed to gpu using device.queue.writeBuffer with WebGPU api, while three.js uses mappedAtCreation.
So, it is faster to use writeBuffer or mappedAtCreation to copy buffers to gpu? Or are there other benefits to use it, maybe for less memory usage?

I think it does not really matter using one or the other as mappedAtCreation can only be used at buffer creation time, which happens infrequently.

When updating an existing buffer, Threejs is also using writeBuffer.

If you are interested, here’s an article about buffer management in WebGPU:

2 Likes