Without testing it more, I can�t tell you,
but your code seems to make sense :)


Ben

On 07 Aug 2014, at 13:47, Camille Teruel <camille.teruel@gmail.com> wrote:

Hi everyone,

I noticed that browsing Object take several seconds (5s on my machine). Evaluate Nautilus openOnClass: Object
After profiling, I found it's because of ClassWidget>>setCachedHierarchyClass: that calls SortHierarchically class>>buildHierarchyForClasses: with a big collection of classes.
But the browser opens on the package view by default, not the hierarchy view.
So if I replace:

ClassWidget>>showHierarchy: anObject
    showHierarchy := anObject.
    self selectedClass ifNotNil:[: class |
        self setCachedHierarchyClass: class]
by:

ClassWidget>>showHierarchy: aBoolean
    (showHierarchy := aBoolean)
        ifTrue: [ self selectedClass ifNotNil: [ :class | self setCachedHierarchyClass: class] ]

it solves the problem. 
But I don't know that part of the system well and I don't know if it's the correct thing to do or if we should try to improve performances of SortHierarchically instead.
So tell me what you think about it.

Thanks,
Camille