[squeak-dev] Inefficiencies

Bert Freudenberg bert at freudenbergs.de
Sat Sep 20 16:49:55 UTC 2014

I *think* the gradient is stored in an LRUCache.

But still, it takes 5 Mbytecodes and 800 Ksends to open a browser, which seems a lot to me. I just did a 

	MessageTally tallySends: [Browser open]

which really gives a mind-boggling peak into what is happening. 

- Bert -

On 20.09.2014, at 17:45, Levente Uzonyi <leves at elte.hu> wrote:

> I know it's an old thread, but I found this in my list of postponed messages:
> If Color class >> #gray: were using #setRGB:, then most of the math could be avoided:
> Color class >> #gray: brightness
> 	"Return a gray shade with the given brightness in the range [0.0..1.0]."
> 	^self basicNew setRGB: ((brightness * ComponentMax) rounded bitAnd: ComponentMask) * 1049601
> ScrollBar >> #updateSliderColor: is strange, because it doesn't use its argument.
> The GradientFillStyles created in #updateSliderColor: could be stored in the ScrollBar itself, instead of recreating them all the time.
> Levente
> On Thu, 24 Jul 2014, Bert Freudenberg wrote:
>> While working on my SqueakJS VM (which now can run a current 4.5 image) I'm discovering a lot of gross inefficiencies. I have no time (or much desire) to fix these, but would anybody think it's valuable if I post them here? For example:
>> ScrollBar>>initializeSlider
>> ScrollBar>>sliderColor:
>> ScrollBar>>updateSliderColor:
>> Color class>>gray:
>> Color>>setRed:green:blue:
>> Float>>rounded
>> Float>>sign
>> Float>>>
>> Number>>adaptToFloat:andCompare:
>> Float>>asTrueFraction
>> Integer>>bitOr:
>> ctx[5]=rcvr: 3436915608L
>> ctx[6]=tmp0: 16r10000000000000L
>> ctx[7]=tmp1: nil
>> Converting a Float to an exact Fraction just to find out its sign seems very much unnecessary. And without the LargeInteger primitive support it also is really really slow.
>> My VM-level debugger makes it easy to stop at any time and look what's taking so long, so that's how I come across these.
>> - Bert -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4142 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140920/0d592428/smime.bin

More information about the Squeak-dev mailing list