<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        <div>Hmm... I don't think the class name matches the icon's identifier that often. Here are some thoughts about performance in tools:</div><div><br></div><div>[ToolIcons iconNamed: #collection] bench</div><div>--- '6,880,000 per second. 145 nanoseconds per run. 12.64 % GC time.'</div><div><br></div><div>[ToolIcons iconNamed: Collection name asLowercase asSymbol] bench </div><div>--- '2,140,000 per second. 467 nanoseconds per run. 4.59908 % GC time.'</div><div><br></div><div>[Set withAllSuperclasses</div><div><span style="white-space:pre">       </span>detect: [:cls | ToolIcons respondsTo: cls name asLowercase asSymbol]</div><div><span style="white-space:pre">  </span>ifFound: [:cls | ToolIcons iconNamed: cls name asLowercase asSymbol  "for caching"]</div><div><span style="white-space:pre">    </span>ifNone: [nil]] bench </div><div>--- '303,000 per second. 3.3 microseconds per run. 2.59948 % GC time.'</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 19.05.2020 20:09:53 schrieb K K Subbu <kksubbu.ml@gmail.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">On 19/05/20 12:32 pm, commits@source.squeak.org wrote:
<br>> +                                ifTrue: [ToolIcons iconNamed: self object class toolIcon]
<br>
<br>Instead of adding a toolIcon method to every class, the code can check 
<br>if ToolIcons already contains a icon under the class name (in lowercase)
<br>
<br>   ToolIcons iconNamed: self object class .. ifAbsent: [ ... ]
<br>
<br>This will avoid trivial methods like:
<br>
<br>Foo class>>toolIcon  ^#foo
<br>
<br>Regards .. Subbu
<br></div></blockquote></div>