Skip to content

Support for growing the memory block size #235

@nical

Description

@nical

Firefox potentially creates a lot of devices and we can't know in advance the type and scale of content that the page will want to run. So it is difficult to come up with a good default memory block size that will work well with very complex web apps without making the cost of very simple ones prohibitive. To address that, one way could be to start with small block size and double it every time a new memory block (for a particular memory type) is needed.

Instead of a single device_memblock_size, the allocator's configuration would let the user specify device_minimum_memblock_size and device_maximum_memblock_size, starting allocations with the former and doubling until the latter is reached. Setting both to the same value would preserve the current behavior.

It would also help with switching wgpu's vulkan backend from gpu-alloc to gpu-allocator since gpu-alloc implements the described behavior.

If this is something you would be OK with supporting, I'd like to find some time to implement it at some point in the next few months.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions