Skip to content

Consider boxing Error in wgsl parser. #4452

Open
@jrmuizel

Description

@jrmuizel

It looks like Error is 80 bytes on x86-64 which will make the Result<> returned from a lot of the lexing functions pretty big. A prototype of this reduced the size of naga::front::wgsl::Parser::parse from 24.2KiB to 21.9KiB. Unfortunately, because of rust-lang/rust#46607 the savings is not as much as it could be because every call to Box::new() ends up with an inlined test for a null return from _rust_alloc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: refactorMaking existing function faster or nicernagaShader Translator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions