Skip to content

Efficient get_nargs #275

Open
Open
@gdalle

Description

@gdalle

In a recent Discourse thread it surfaced that get_nargs takes up a sizeable part of the benchmark. The reason is that it allocates the whole methods table before considering the first element:

get_nargs(f) = first(methods(f)).nargs - 1

Besides it is not necessarily accurate if several methods have varying numbers of arguments. Any idea how we could overcome this?

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