[Enh][VM] primitiveApplyToFromTo for the heart of theenumeration of collections?

J J azreal1977 at hotmail.com
Mon Sep 18 19:05:24 UTC 2006


>From: Bryce Kampjes <bryce at kampjes.demon.co.uk>
>Reply-To: The general-purpose Squeak developers 
>list<squeak-dev at lists.squeakfoundation.org>
>To: The general-purpose Squeak developers 
>list<squeak-dev at lists.squeakfoundation.org>
>Subject: Re: [Enh][VM] primitiveApplyToFromTo for the heart of 
>theenumeration of collections?
>Date: Sun, 17 Sep 2006 21:04:39 +0100
>
>Exupery already optimises do: by a factor of 50%.

But I'm not talking about Exupery.  In fact I don't think anyone (else) is.

I do thing Exupery is a good thing.  I hope you can get it going so fast it 
competes
with c++ and beats Java.  But even if it does, we will still want to develop 
smalltalk
code in the interpreted environment, so speed counts there too.

>
>The library should also be readable. This is Smalltalk, we all read
>the library code all the time. But I'm repeating myself. There is
>a value judgement between readability and speed. We differ in I don't
>feel speed is worth it at all costs.
>

You and I don't differ on this.  I think readability is important.  In fact 
that is what this whole
thing is about for me.  Right now people are writing algorythms directly 
instead of using
the library, because the library code is 3 times slower.  That hurts 
redability and
maintainability.

>As yet no-one has demonstrated a single practical use of occurencesOf:
>where the speed difference would matter. No one has shown any
>realistic benchmarks where speeding up do: and friends would matter.
>

I don't get it.  Right now occurencesOf: impliments a counter.  Instead of 
using the
library message count: it duplicates the code.  Why?  Well maybe because 
count: didn't
exist when it was made.  So we asked about just changing it, and then 
Andreas (I think it was)
pointed out that that change would make the occurencesOf: method 3 times 
slower.
This is a problem.  You agree right?

If Klaus' proposal is wrong ok.  But what is right.  There must be some way 
to make count:
not have such a high cost of use compared to just reimplimenting it over and 
over.





More information about the Squeak-dev mailing list