[Pharo-project] [Nautilus] Slow Package Menu on Mouse Button Right Click + Fix
Dear Pharoers, thank you all for your time and great contributions! Here is a quick performance fix for Nautilus. In Pharo2.0a #20581 and previous versions, selecting the package menu with my right mouse button lasts too long; here is why: 95.4% {564ms} NautilusUI(AbstractNautilusUI)>>packageMenuBuilder 95.4% {564ms} PragmaMenuBuilder class>>withAllPragmaKeywords:model: 95.4% {564ms} PragmaMenuBuilder>>buildTree 95.4% {564ms} PragmaMenuBuilder>>collectRegistrations *90.3%* {534ms} CriticBrowser class>>packagesMenu: Solution, only call CriticsBrowser initialization when this exact menu item is selected. CriticsBrowser>>packagesMenu: aBuilder <nautilusGlobalPackageMenu> (aBuilder item: #'Critics Browser') action: [ | packages target env rules | target := aBuilder model. packages := OrderedCollection new. target selectedPackages do: [:p | MCWorkingCopy managersForCategory: p packageName do: [:package | packages add: package]]. rules := RBCompositeLintRule allGoodRules. env := (RBPackageEnvironment new packages: packages ). self openOnRule: rules onEnvironment: env]; help: 'Running critics rules on this package'. Maybe there are more
Maybe there are more
menu generator menthods like this. i.e. the CriticBrowser>packagesGroup: can be optimized the same way. packagesGroup: aBuilder <nautilusGlobalGroupMenu> (aBuilder item: #'Critics Browser') action: [ | packages target env rules group | target := aBuilder model. group := target selectedGroups. packages := OrderedCollection new. group do: [ :each | each classes do: [ :cl | MCWorkingCopy managersForClass: cl do: [ :package | packages add: package ] ] ]. rules := RBCompositeLintRule allGoodRules. env := RBPackageEnvironment new packages: packages. self openOnRule: rules onEnvironment: env ]; help: 'Running critics rules on this group' Regards, Mike
On Mar 4, 2013, at 2:41 PM, "Müller, Mike" <mike@objektarium.de> wrote:
Dear Pharoers,
thank you all for your time and great contributions!
Here is a quick performance fix for Nautilus.
Thanks a lot! I have added a tracker entry: http://code.google.com/p/pharo/issues/detail?id=7634 Very good to speed this up again. Marcus
Thank you Marcus, I've created a Slice with the 2 changes in PharoInbox. Name: SLICE-Issue-7634--Slow-Package-Menu-on-Mouse-Button-Right-Click--Fix--MikeMueller.1 CriticBrowser>packagesGroup: CriticBrowser>packagesMenu: move CriticBrowser initialization into action: block for speedup of the menu building Mike 2013/3/4 Marcus Denker <marcus.denker@inria.fr>
On Mar 4, 2013, at 2:41 PM, "Müller, Mike" <mike@objektarium.de> wrote:
Dear Pharoers,
thank you all for your time and great contributions!
Here is a quick performance fix for Nautilus.
Thanks a lot!
I have added a tracker entry: http://code.google.com/p/pharo/issues/detail?id=7634
Very good to speed this up again.
Marcus
-- Mit freundlichen GrüÃen Mike Müller -- objektarium Mike Müller IT-Architekt Im Gewerbepark A10 93059 Regensburg Tel: +49 (941) 780 31 89 Mobil: +49 (151) 226 283 77 info@objektarium.de http://www.objektarium.de -= objekte orientieren sich an uns =-
Thanks a lot Mike. Such contributions are really welcome. We are all working like nuts on so many things :). Stef
Dear Pharoers,
thank you all for your time and great contributions!
Here is a quick performance fix for Nautilus.
In Pharo2.0a #20581 and previous versions, selecting the package menu with my right mouse button lasts too long; here is why:
95.4% {564ms} NautilusUI(AbstractNautilusUI)>>packageMenuBuilder 95.4% {564ms} PragmaMenuBuilder class>>withAllPragmaKeywords:model: 95.4% {564ms} PragmaMenuBuilder>>buildTree 95.4% {564ms} PragmaMenuBuilder>>collectRegistrations 90.3% {534ms} CriticBrowser class>>packagesMenu:
Solution, only call CriticsBrowser initialization when this exact menu item is selected.
CriticsBrowser>>packagesMenu: aBuilder <nautilusGlobalPackageMenu> (aBuilder item: #'Critics Browser') action: [ | packages target env rules | target := aBuilder model. packages := OrderedCollection new. target selectedPackages do: [:p | MCWorkingCopy managersForCategory: p packageName do: [:package | packages add: package]]. rules := RBCompositeLintRule allGoodRules. env := (RBPackageEnvironment new packages: packages ). self openOnRule: rules onEnvironment: env]; help: 'Running critics rules on this package'.
Maybe there are more
Don't forget to sign the license and send it if you didn't do it yet! Best, On Mon, Mar 4, 2013 at 4:50 PM, stephane ducasse <stephane.ducasse@free.fr>wrote:
Thanks a lot Mike. Such contributions are really welcome. We are all working like nuts on so many things :).
Stef
Dear Pharoers,
thank you all for your time and great contributions!
Here is a quick performance fix for Nautilus.
In Pharo2.0a #20581 and previous versions, selecting the package menu with my right mouse button lasts too long; here is why:
95.4% {564ms} NautilusUI(AbstractNautilusUI)>>packageMenuBuilder 95.4% {564ms} PragmaMenuBuilder class>>withAllPragmaKeywords:model: 95.4% {564ms} PragmaMenuBuilder>>buildTree 95.4% {564ms} PragmaMenuBuilder>>collectRegistrations *90.3%* {534ms} CriticBrowser class>>packagesMenu:
Solution, only call CriticsBrowser initialization when this exact menu item is selected.
CriticsBrowser>>packagesMenu: aBuilder <nautilusGlobalPackageMenu> (aBuilder item: #'Critics Browser') action: [ | packages target env rules | target := aBuilder model. packages := OrderedCollection new. target selectedPackages do: [:p | MCWorkingCopy managersForCategory: p packageName do: [:package | packages add: package]]. rules := RBCompositeLintRule allGoodRules. env := (RBPackageEnvironment new packages: packages ). self openOnRule: rules onEnvironment: env]; help: 'Running critics rules on this package'.
Maybe there are more
-- Mariano http://marianopeck.wordpress.com
+1 On Mar 4, 2013, at 9:30 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Don't forget to sign the license and send it if you didn't do it yet!
Best,
On Mon, Mar 4, 2013 at 4:50 PM, stephane ducasse <stephane.ducasse@free.fr> wrote: Thanks a lot Mike. Such contributions are really welcome. We are all working like nuts on so many things :).
Stef
Dear Pharoers,
thank you all for your time and great contributions!
Here is a quick performance fix for Nautilus.
In Pharo2.0a #20581 and previous versions, selecting the package menu with my right mouse button lasts too long; here is why:
95.4% {564ms} NautilusUI(AbstractNautilusUI)>>packageMenuBuilder 95.4% {564ms} PragmaMenuBuilder class>>withAllPragmaKeywords:model: 95.4% {564ms} PragmaMenuBuilder>>buildTree 95.4% {564ms} PragmaMenuBuilder>>collectRegistrations 90.3% {534ms} CriticBrowser class>>packagesMenu:
Solution, only call CriticsBrowser initialization when this exact menu item is selected.
CriticsBrowser>>packagesMenu: aBuilder <nautilusGlobalPackageMenu> (aBuilder item: #'Critics Browser') action: [ | packages target env rules | target := aBuilder model. packages := OrderedCollection new. target selectedPackages do: [:p | MCWorkingCopy managersForCategory: p packageName do: [:package | packages add: package]]. rules := RBCompositeLintRule allGoodRules. env := (RBPackageEnvironment new packages: packages ). self openOnRule: rules onEnvironment: env]; help: 'Running critics rules on this package'.
Maybe there are more
-- Mariano http://marianopeck.wordpress.com
Don't forget to sign the license and send it if you didn't do it yet!
I have already signed the licence agreement in April 2008, when I submitted my first patch. <http://forum.world.st/Software-update-td2068015.html#a2073872>
According to <https://code.google.com/p/pharo/wiki/ListOfOkCommitters> there is a user named 'Mike Muller', which should be me. Thanks, Mike (currently preparing his third contribution, to be released in 2018 ;-))
participants (4)
-
Marcus Denker -
Mariano Martinez Peck -
Müller, Mike -
stephane ducasse