This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Why is there an implicit Array.Projection[E] => Array[E] conversion?

2 replies
Paul Chiusano
Joined: 2009-01-01,
User offline. Last seen 42 years 45 weeks ago.

I was kind of surprised when I passed the result of Array.slice to a method taking an Array. Since this conversion makes a copy of the data, it seems like the sort of feature that could silently cause performance bugs!

 
Should I file a ticket for this?
 
Paul

tolsen77
Joined: 2008-10-08,
User offline. Last seen 1 year 38 weeks ago.
Re: Why is there an implicit Array.Projection[E] => Array[E] c
I reported performance problems for Array.slice a while ago and it has/going-to-be changed (I'm not using the current release).

Link: http://www.nabble.com/Scaling-problems-for-Array.slice-on-large-arrays-to21638762.html

On Tue, Mar 10, 2009 at 7:34 PM, Paul Chiusano <paul.chiusano@gmail.com> wrote:
I was kind of surprised when I passed the result of Array.slice to a method taking an Array. Since this conversion makes a copy of the data, it seems like the sort of feature that could silently cause performance bugs!   Should I file a ticket for this?   Paul

odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
Re: Why is there an implicit Array.Projection[E] => Array[E] c

On Tue, Mar 10, 2009 at 7:34 PM, Paul Chiusano wrote:
> I was kind of surprised when I passed the result of Array.slice to a method
> taking an Array. Since this conversion makes a copy of the data, it seems
> like the sort of feature that could silently cause performance bugs!
>
> Should I file a ticket for this?

Maybe not right now. The whole projection thing will be redesigned anyway.
I'll keep in mind what you wrote when I get to it.

Cheers

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland