[Cython] Fused type signature resolution failures

Stefan Behnel stefan_ml at behnel.de
Sun Jun 22 14:01:28 CEST 2014


Pauli Virtanen, 22.06.2014 13:35:
> 22.06.2014 13:48, Stefan Behnel kirjoitti:
>> Generally speaking, I think that the signature matching algorithm has some
>> room for improvements, especially the one that matches Python signatures at
>> runtime.
>>
>> We should take a look at how other implementations do this dispatch. There
>> are multiple "generic functions" implementations for Python that do similar
>> things.
> 
> I agree that there probably is room for improvement, possibly also
> speed-wise.

Definitely speed-wise. I was considering to get rid of the "build a key and
do a dict lookup" approach and just do sequential type checks instead,
although looking at your example with its dozen of different numeric types
in one fused type makes me worry that there might be code out there that
actually benefits from dict usage. Still, I'm sure it would be possible to
speed up the most common case of exactly one fused type in a signature,
maybe also that of two, or that of one structured (i.e. array) type.
Everything else isn't worth it, I guess.


> I'll try to revisit (at some point) the csparsetools Cython
> implementation to see if there are low-hanging fixes that would be
> useful there.

That would be great.

Stefan



More information about the cython-devel mailing list