Skip to content

fused function dispatch is slow for Python calls #1385

@robertwb

Description

@robertwb

Fused function dispatch currently generates a lot of generic code. In most cases, however, the number of distinct fused types in a function signature will be 1 or 2, so a short if-cascade would likely produce less code and be much faster.

The dispatch code is generated in make_fused_cpdef() in FusedNode.py. It generates Cython code. This could be optimised for the common case of a few (positional) arguments by dispatching directly based on the argument types, instead of comparing full signatures in a loop at runtime.

Migrated from http://trac.cython.org/ticket/829

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions