Skip to content

Device::create_buffer is sometimes slow (4ms) and slows down rendering. #5984

Open
@John-Nagle

Description

@John-Nagle

Description
Performance bottleneck found with Tracy: too much time is spent in "Device::create_buffer" and that seems to delay other thread.
This should be a fast operation, but it's taking about 4ms at times.

Repro steps

  1. Get render-bench.. Build branch "hp" in release mode.
  2. Run with the Tracy profiler 0.10
  3. Zoom in on the slowest frames in the profiler.

The test creates a large number of visible objects on screen, waits 10 seconds, deletes them, waits 10 seconds, etc. So capture one full create/delete cycle.

Expected vs observed behavior
The part of the code in the profiling scope "Device::create_buffer" is 1) taking as long as 4ms, and 2) locking out some other operations in the render thread. As far as I can tell, that ought to be a fast operation.

Extra materials
Screenshot of the trace.
renderbenchcreatebuffer1

Full Tracy trace file:
renderbenchcreatebuffer.zip

Platform
WGPU 0.20 from crates.io
Linux 22.04 LTS.
NVidia 3070. Driver 535 (proprietary, tested)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions