Re: [Pharo-dev] Performance of [ * ] repeat vs [ * . true ] whileTrue

2016-08-15 Thread Eliot Miranda
On Mon, Aug 15, 2016 at 9:11 AM, Clément Bera wrote: > > > On Mon, Aug 15, 2016 at 12:54 AM, John Brant > wrote: > >> >> > On Aug 14, 2016, at 4:42 PM, Henrik Nergaard >> wrote: >> > >> > Hi, >> > >> > Why is “[ * ] repeat” almost twice as slow as “[ * . true ] whileTrue” >> ? >> >> #repeat is

Re: [Pharo-dev] Performance of [ * ] repeat vs [ * . true ] whileTrue

2016-08-15 Thread Clément Bera
On Mon, Aug 15, 2016 at 12:54 AM, John Brant wrote: > > > On Aug 14, 2016, at 4:42 PM, Henrik Nergaard > wrote: > > > > Hi, > > > > Why is “[ * ] repeat” almost twice as slow as “[ * . true ] whileTrue” ? > > #repeat isn’t optimized by the compiler like #whileTrue is. I don’t know > if there is

Re: [Pharo-dev] Performance of [ * ] repeat vs [ * . true ] whileTrue

2016-08-14 Thread John Brant
> On Aug 14, 2016, at 4:42 PM, Henrik Nergaard wrote: > > Hi, > > Why is “[ * ] repeat” almost twice as slow as “[ * . true ] whileTrue” ? #repeat isn’t optimized by the compiler like #whileTrue is. I don’t know if there is a reason for this, but most every other Smalltalk (Squeak, VW, & D

[Pharo-dev] Performance of [ * ] repeat vs [ * . true ] whileTrue

2016-08-14 Thread Henrik Nergaard
Hi, Why is "[ * ] repeat" almost twice as slow as "[ * . true ] whileTrue" ? -- [ | n | n := 0. [ [ n := n + 1. n > 1 ifTrue: [ Error signal ] ] repeat ] on: Error do: [ :err | ]. ] timeToRu