Symbol>>capitalized?
Todd Blanchard
tblanchard at mac.com
Tue Jan 2 00:04:49 UTC 2007
Squeak 3.7 ish -
I've got this meta model that stores attribute names as symbols.
I frequently derive labels from the attribute names and this often
ends up calling #capitalized on the symbol.
I generally figure any string manipulation on a symbol results in a
string but Symbol>>capitalized is implemented as
capitalized
^self asString capitalized asSymbol
I found this while watching the process browser running a lengthy
script in the background and found about 80% of time was spent in
WeakSet scanFor:
I did a search of the image and couldn't find a single instance of
sending capitalized to a symbol where the caller was going to use it
as a symbol rather than a string.
So, in the name of performance, I vote to nuke this method or change
it to just return a string.
More information about the Squeak-dev
mailing list
|