[squeak-dev] 30 bit unboxed floats

Igor Stasenko siguctua at gmail.com
Mon Oct 18 21:09:32 UTC 2010


i'd say, depending for what purpose you using a language and
applications implemented in it (float math, or web server),
the choice between chars/immediate floats are not obvious.

My own opinion, it should be floats. Because characters in fact is
nothing more than integer number , identifying a code point in
some encoding. And in general, this means, that with proper design,
one could avoid using encapsulated integers (which Character are), but
instead use integer values directly.
So, there are many places, where impact of boxing characters on
performance could be minimized. Because one could manipulate with
(sub)strings, instead of individual characters.

In contrast, floats having much less potential for optimization like
that. Of course , we having a FloatArray-s and stuff like that,
but once you writing down a code to evaluate some formula, it going to
deal with a single floating-point value(s).
This is what you never doing with characters , writing formulae... :)


On 18 October 2010 23:49, Colin Putney <colin at wiresong.com> wrote:
> On Mon, Oct 18, 2010 at 1:38 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>
>> I think immediate characters are much more generally useful, especially
>> considering unicode.  The current implementation of only codes 0 to 255
>> being == is error-prone.
>
> I enthusiastically agree. I think string handling in Squeak is pretty
> weak, and having efficient Characters would provide a solid basis for
> improving it.
>
> Colin
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list