- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
What's the current status of type specialization?
Sat, 2010-02-20, 16:41
Hi,
Today I tried to implement a demo for @specialized. The compiler did its job, but at runtime I got an AbstractMethodError.What's the current status of type specialization? Should it work?
Heiko
Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Today I tried to implement a demo for @specialized. The compiler did its job, but at runtime I got an AbstractMethodError.What's the current status of type specialization? Should it work?
Heiko
Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Sun, 2010-02-21, 10:07
#2
Re: What's the current status of type specialization?
Iulian,
Thanks for your quick response!
On 20 February 2010 17:20, Iulian Dragos <iulian.dragos@epfl.ch> wrote:
Sounds good ;-)
Did it: https://lampsvn.epfl.ch/trac/scala/ticket/3085
Thanks,
Heiko
Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Thanks for your quick response!
On 20 February 2010 17:20, Iulian Dragos <iulian.dragos@epfl.ch> wrote:
Yes, it should work.
Sounds good ;-)
Development has slowed down quite a bit since I am writing my thesis, and that's part of the reason specialization is still a -Y option (in other words, use on your own risk). It is for the most part feature-complete, so please file tickets with the bugs you find, that would help us a lot.
Did it: https://lampsvn.epfl.ch/trac/scala/ticket/3085
Thanks,
Heiko
Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Mon, 2010-02-22, 14:37
#3
Re: What's the current status of type specialization?
Iulian,
You closed the ticket commenting "(In [20949]) Specialized types are not substituted inside type arguments.". I am not sure if I fully understand => Could you please explain?
Thank you,
Heiko
On 21 February 2010 10:05, Heiko Seeberger <heiko.seeberger@googlemail.com> wrote:
You closed the ticket commenting "(In [20949]) Specialized types are not substituted inside type arguments.". I am not sure if I fully understand => Could you please explain?
Thank you,
Heiko
On 21 February 2010 10:05, Heiko Seeberger <heiko.seeberger@googlemail.com> wrote:
Iulian,
Thanks for your quick response!
On 20 February 2010 17:20, Iulian Dragos <iulian.dragos@epfl.ch> wrote:
Yes, it should work.
Sounds good ;-)Development has slowed down quite a bit since I am writing my thesis, and that's part of the reason specialization is still a -Y option (in other words, use on your own risk). It is for the most part feature-complete, so please file tickets with the bugs you find, that would help us a lot.
Did it: https://lampsvn.epfl.ch/trac/scala/ticket/3085
Thanks,
Heiko
Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Mon, 2010-02-22, 14:47
#4
Re: What's the current status of type specialization?
Hi Heiko,
On Mon, Feb 22, 2010 at 1:33 PM, Heiko Seeberger
wrote:
> Iulian,
> You closed the ticket commenting "(In [20949]) Specialized types are not
> substituted inside type arguments.".
> I am not sure if I fully understand => Could you please explain?
It means that Iulian fixed the bug in that changeset:
https://lampsvn.epfl.ch/trac/scala/changeset/20949
Best,
Ismael
Mon, 2010-02-22, 15:17
#5
Re: What's the current status of type specialization?
Ah, great!
Thanks,
Heiko
On 22 February 2010 14:38, Ismael Juma <mlists@juma.me.uk> wrote:
--
Heiko Seeberger
Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Thanks,
Heiko
On 22 February 2010 14:38, Ismael Juma <mlists@juma.me.uk> wrote:
Hi Heiko,
On Mon, Feb 22, 2010 at 1:33 PM, Heiko Seeberger
<heiko.seeberger@googlemail.com> wrote:
> Iulian,
> You closed the ticket commenting "(In [20949]) Specialized types are not
> substituted inside type arguments.".
> I am not sure if I fully understand => Could you please explain?
It means that Iulian fixed the bug in that changeset:
https://lampsvn.epfl.ch/trac/scala/changeset/20949
Best,
Ismael
--
Heiko Seeberger
Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Mon, 2010-02-22, 15:47
#6
Re: What's the current status of type specialization?
On 22 February 2010 14:38, Ismael Juma <mlists@juma.me.uk> wrote:
Hi Heiko,
On Mon, Feb 22, 2010 at 1:33 PM, Heiko Seeberger
<heiko.seeberger@googlemail.com> wrote:
> Iulian,
> You closed the ticket commenting "(In [20949]) Specialized types are not
> substituted inside type arguments.".
> I am not sure if I fully understand => Could you please explain?
It means that Iulian fixed the bug in that changeset:
In short, yes. The problem was that specialized types were propagated too eagerly, so in your example the function literal was typed "Int => SpecializedPair$mcI$sp" instead of "Int => SpecializedPair[Int]". The AbstractMethodError appeared because the apply method in the Function1 trait was implemented at SpecializedPair$mcI$sp.
I ran you example and the speedup was not very impressive. I think that's because the running time was dominated by memory operations (on my system I got around 10.000 L2 cache misses). A better benchmark would be the matrix multiplication routine I checked in in the same commit, under test/files/run/spec-matrix.scala.
iulian
https://lampsvn.epfl.ch/trac/scala/changeset/20949
Best,
Ismael
--
Heiko Seeberger
Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais
Mon, 2010-02-22, 15:57
#7
Re: What's the current status of type specialization?
Hi Iulian,
On Mon, Feb 22, 2010 at 2:36 PM, Iulian Dragos wrote:
> I think that's
> because the running time was dominated by memory operations (on my system I
> got around 10.000 L2 cache misses).
Out of curiosity, what did you use to measure the L2 cache misses?
Thanks,
Ismael
Mon, 2010-02-22, 17:27
#8
Re: What's the current status of type specialization?
On Mon, Feb 22, 2010 at 3:45 PM, Ismael Juma <mlists@juma.me.uk> wrote:
Hi Iulian,
On Mon, Feb 22, 2010 at 2:36 PM, Iulian Dragos <iulian.dragos@epfl.ch> wrote:
> I think that's
> because the running time was dominated by memory operations (on my system I
> got around 10.000 L2 cache misses).
Out of curiosity, what did you use to measure the L2 cache misses?
Shark, a Mac OS X profiler can read hardware performance counters.
iulian
Thanks,
Ismael
--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais
Mon, 2010-02-22, 17:37
#9
Re: What's the current status of type specialization?
On Mon, Feb 22, 2010 at 4:14 PM, Iulian Dragos wrote:
> Shark, a Mac OS X profiler can read hardware performance counters.
> iulian
Cool, thanks.
Ismael
thanks,iulian
On Sat, Feb 20, 2010 at 4:40 PM, Heiko Seeberger <heiko.seeberger@googlemail.com> wrote:
--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais