Skip to content

Outline all asserts (and throws?) #35221

Closed
@PallHaraldsson

Description

@PallHaraldsson

A.
All @asserts should be exceptional, and since it's a macro already, it should outline (@noinline) automatically, as was manually done here (to avoid 3x speed regression):

https://github.com/JuliaLang/julia/pull/34237/files

B.
I was looking into optimizing factorial myself, and think in general throws should be outlined too, i.e. all preconditions. For now A. is a low hanging-fruit I think. I'm not sure, possibly after A. is done, throws can be implemented with asserts, getting B for free?

C.
Maybe there are complications when there are two or more asserts and/or throws, still I doubt solving A. and/or B. would be slower then. However possibly in that case something even better could be done?

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