[Cuis-dev] usefulness of a faster #timesRepeat?
Nicolas Cellier
nicolas.cellier.aka.nice at gmail.com
Sat Nov 9 00:35:43 PST 2019
Hi,
2^30 loops (10^9)!
we should stop accelerating the VM, this is creating problems!
Note that there is a benchFor: 3 seconds or whatever Duration in Squeak.
Le sam. 9 nov. 2019 à 05:19, Andres Valloud via Cuis-dev <
cuis-dev at lists.cuis.st> a écrit :
> Hi,
>
> >> First, especially in 32 bit systems, it's very important never to send
> >> timesRepeat: to a large integer --- this is why the large integer
> >> method splits the process in rounds of timesRepeat: sent to small
> >> integers.
> >
> > I guess you mean 'never run the iteration on LargeInteger arithmetic',
> > so with the splitting in LargePositiveInteger, sending timesRepeat: to a
> > large integer is ok...
>
> Yeah, that's what I meant. If you only had the simple implementation in
> Integer, then the to:do: will create large integers for every iteration.
> That is a) slow in itself, and b) creates garbage that later has to be
> collected.
>
> > Interesting. Not the case in Cuis, where there is no Compiler
> > optimization of #timesRepeat:
>
> Right --- if that did happen though, then we'd be looking at writing
> timesRepeat: [aBlock value].
>
> > Still, I wasn't explicit on what I really wanted to ask... My question
> > is: Is #bench (or bench: seconds) a good replacement for #timesRepeat:?
> > If so, does still make sense to have an optimized version of
> #timesRepeat:?
>
> If there was bench: seconds, and if that accepted a float argument so
> one could say things like bench: 1.5 and things like that, then the
> timesRepeat: improvement would be less important for this use case.
>
> The timesRepeat: improvements might still matter, but we'd have to find
> another justification for them first.
>
> Andres.
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191109/9c6bfc55/attachment.htm>
More information about the Cuis-dev
mailing list