Skip to content

Optional allocations #69

@Serdan

Description

@Serdan

Because Optional is a reference type it causes heap allocations, which adds to garbage collection and all that nasty stuff we want to avoid in game dev. I just did a quick examination and it should be fairly straight-forward to make it a struct instead. This would be a breaking change for anyone who consumes the type directly, so I'm curious what you think @dcronqvist

One option is to add a ValueOptional to use internally and just leave the existing type as is.

I'd be happy to make a PR for whatever solution you decide on.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    readyIn the dev branch, but not yet on master (not available as a package)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions