Le mardi 07 janvier 2014 à 12:28 -0500, Stefan Karpinski a écrit :
> You actually can when you use a tuple because the number of elements
> in a tuple is part of its type, so type inference can figure out how
> many elements a tuple has and eliminate the overhead. In this case,
> you're splatting an array and it's length is not something that can be
> inferred, so lots of work has to be done at run time to do the
> dispatch. This could maybe be optimized but I really think it's better
> to write the code differently.
> 
No, I'm using a tuple in the first table() function (in the branch where
usena=false, which is the one I tested for this comparison). The el
tuple is built using ntuple(n, ...), where n is the length of the
varargs. Couldn't this be optimized more efficiently?

Else, what's the recommended pattern? Computing the linear index as I do
in table3()?


Regards

Reply via email to