On Fri, Jul 22, 2011 at 9:44 PM, rklaehn <
rkl...@googlemail.com> wrote:
> Hi all,
>
> I am using @specialized to save massive amounts of code duplication.
> However, it seems that using @specialized with arrays does not produce
> what I would have expected.
>
> It seems that while there are "specialized" frontends being generated,
> the actual implementation (the little that there is) is not being
> specialized.
>
> Is that a fundamental limitation of @specialized, or am I doing
> something wrong? I did compile with optimize. If this is indeed a
> limitation of @specialized, then I must say that it is pretty severe.
> Usually primitive arrays are what you use if you really need high
> performance and compact in memory representation.
>
> Here is a very small class to illustrate the problem:
>
> class Test[@specialized(Byte, Short, Int, Long, Float, Double) T] {
> def get(a:Array[T], i:Int) = a(i)
> }
>
> And here is the byte code: