Skip to content

Avoid __init__ to reduce load time #340

@KristofferC

Description

@KristofferC

ChainRulesCore causes significant load time regressions in packages that depend on it (e.g. JuliaMath/SpecialFunctions.jl#310). A significant amount of that is contributed to the __init__ function that unconditionally has to be run when the package is loaded since this has to be inferred and compiled.

Removing the __init__ reduces approximately cuts the load time of the package to a factor of 1/3. If this package is supposed to be dependent on by such core packages as SpecialFunctions it would be good if its goals could be achieved with standard dispatch which the package loading system is optimized for, instead of running arbitrary code at load time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions