Morphic cleaning

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Morphic cleaning

jannik laval
Hi all,

I have used SystemNavigation>>unsentMessagesInPackageNamed:
on the package Morphic.

The result is in the attached file.
I begin to remove some methods (in the SLICE-MorphicCleaning):
- MouseButtonEvent >> #redButtonChanged
- WindowColorSpec >> #pastelColor
- Morph >> #adjustedCenter:
- NewParagraph >> #asParagraphForPostscript
- PaintBoxMorph >> #init3
- Morph >> #removeAllButFirstSubmorph
- NewParagraph >> #testNewComposeAll3
- AlignmentMorph >> #convertOldAlignmentsNov2000:using:
- NewParagraph >> #testNewComposeAll2
- Morph >> #altSpecialCursor3:
- Canvas >> #drawString:from:to:at:font:color:underline:underlineColor:strikethrough:strikethroughColor:
- MorphicEvent >> #convertOctober2000:using:
- PaintBoxMorph >> #init4
- WindowColorSpec >> #brightColor
- Morph >> #firstClickTimedOut:

And I think we need to remove a lot of things before improve Morphic algorithms.
But some methods could be useful.

If anyone want to clean Morphic the file is attached.




Cheers
---
Jannik Laval
---


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

MorphicUnsent.txt (30K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Mariano Martinez Peck
Excellent work Jannik :)

Just for curious, you checked that in a core image or dev ?

Cheers

Mariano

2010/2/5 Laval Jannik <[hidden email]>
Hi all,

I have used SystemNavigation>>unsentMessagesInPackageNamed:
on the package Morphic.

The result is in the attached file.
I begin to remove some methods (in the SLICE-MorphicCleaning):
- MouseButtonEvent >> #redButtonChanged
- WindowColorSpec >> #pastelColor
- Morph >> #adjustedCenter:
- NewParagraph >> #asParagraphForPostscript
- PaintBoxMorph >> #init3
- Morph >> #removeAllButFirstSubmorph
- NewParagraph >> #testNewComposeAll3
- AlignmentMorph >> #convertOldAlignmentsNov2000:using:
- NewParagraph >> #testNewComposeAll2
- Morph >> #altSpecialCursor3:
- Canvas >> #drawString:from:to:at:font:color:underline:underlineColor:strikethrough:strikethroughColor:
- MorphicEvent >> #convertOctober2000:using:
- PaintBoxMorph >> #init4
- WindowColorSpec >> #brightColor
- Morph >> #firstClickTimedOut:

And I think we need to remove a lot of things before improve Morphic algorithms.
But some methods could be useful.

If anyone want to clean Morphic the file is attached.




Cheers
---
Jannik Laval
---


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

jannik laval
Hi Mariano,
This is in a Core image :)

On Feb 5, 2010, at 12:02 , Mariano Martinez Peck wrote:

Excellent work Jannik :)

Just for curious, you checked that in a core image or dev ?

Cheers

Mariano

2010/2/5 Laval Jannik <[hidden email]>
Hi all,

I have used SystemNavigation>>unsentMessagesInPackageNamed:
on the package Morphic.

The result is in the attached file.
I begin to remove some methods (in the SLICE-MorphicCleaning):
- MouseButtonEvent >> #redButtonChanged
- WindowColorSpec >> #pastelColor
- Morph >> #adjustedCenter:
- NewParagraph >> #asParagraphForPostscript
- PaintBoxMorph >> #init3
- Morph >> #removeAllButFirstSubmorph
- NewParagraph >> #testNewComposeAll3
- AlignmentMorph >> #convertOldAlignmentsNov2000:using:
- NewParagraph >> #testNewComposeAll2
- Morph >> #altSpecialCursor3:
- Canvas >> #drawString:from:to:at:font:color:underline:underlineColor:strikethrough:strikethroughColor:
- MorphicEvent >> #convertOctober2000:using:
- PaintBoxMorph >> #init4
- WindowColorSpec >> #brightColor
- Morph >> #firstClickTimedOut:

And I think we need to remove a lot of things before improve Morphic algorithms.
But some methods could be useful.

If anyone want to clean Morphic the file is attached.




Cheers
---
Jannik Laval
---


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

---
Jannik Laval
PhD Student - Rmod Team - INRIA
Certified Project Management Associate (IPMA)
---


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Henrik Sperre Johansen
In reply to this post by jannik laval
Den 05.02.2010 11:15, skrev Laval Jannik:
> Hi all,
>
> I have used SystemNavigation>>unsentMessagesInPackageNamed:
> on the package Morphic.
>
Wow, I feel your pain, the runtime of that method is quite brutal for
large packages...

Find attached a somewhat faster (but still slow) implementation.

Test:
findTime := [unsent := SystemNavigation default
unsentMessagesInPackageNamed: 'Morphic'] timeToRun

Numbers on my machine:
Current:
findTime - 29 minutes, 35 seconds.
unsent size - 531

Attached:
findTime - 3 minutes, 9 seconds.
unsent size - 531

Cheers,
Henry

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

UnsentTesting.1.cs (1013 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Stéphane Ducasse
Excellent!


On Feb 5, 2010, at 1:54 PM, Henrik Johansen wrote:

> Den 05.02.2010 11:15, skrev Laval Jannik:
>> Hi all,
>>
>> I have used SystemNavigation>>unsentMessagesInPackageNamed:
>> on the package Morphic.
>>
> Wow, I feel your pain, the runtime of that method is quite brutal for
> large packages...
>
> Find attached a somewhat faster (but still slow) implementation.
>
> Test:
> findTime := [unsent := SystemNavigation default
> unsentMessagesInPackageNamed: 'Morphic'] timeToRun
>
> Numbers on my machine:
> Current:
> findTime - 29 minutes, 35 seconds.
> unsent size - 531
>
> Attached:
> findTime - 3 minutes, 9 seconds.
> unsent size - 531
>
> Cheers,
> Henry
> <UnsentTesting.1.cs>_______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Stéphane Ducasse
In reply to this post by Henrik Sperre Johansen
[update 1.1] #11196
11196
-----

- faster isUnsentMessage: tx Henrik





On Feb 5, 2010, at 1:54 PM, Henrik Johansen wrote:

> Den 05.02.2010 11:15, skrev Laval Jannik:
>> Hi all,
>>
>> I have used SystemNavigation>>unsentMessagesInPackageNamed:
>> on the package Morphic.
>>
> Wow, I feel your pain, the runtime of that method is quite brutal for
> large packages...
>
> Find attached a somewhat faster (but still slow) implementation.
>
> Test:
> findTime := [unsent := SystemNavigation default
> unsentMessagesInPackageNamed: 'Morphic'] timeToRun
>
> Numbers on my machine:
> Current:
> findTime - 29 minutes, 35 seconds.
> unsent size - 531
>
> Attached:
> findTime - 3 minutes, 9 seconds.
> unsent size - 531
>
> Cheers,
> Henry
> <UnsentTesting.1.cs>_______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Henrik Sperre Johansen
You can now do

findTime := [unsent := SystemNavigation default
unsentMessagesInPackageNamed: '*'] timeToRun

in the time it used to take for Morphic alone. (about 30 mins)
That's the entire system btw, 7486  unsents in my core image ;)

Cheers,
Henry


Den 05.02.2010 14:11, skrev Stéphane Ducasse:

> [update 1.1] #11196
> 11196
> -----
>
> - faster isUnsentMessage: tx Henrik
>
>
>
>
>
> On Feb 5, 2010, at 1:54 PM, Henrik Johansen wrote:
>
>  
>> Den 05.02.2010 11:15, skrev Laval Jannik:
>>    
>>> Hi all,
>>>
>>> I have used SystemNavigation>>unsentMessagesInPackageNamed:
>>> on the package Morphic.
>>>
>>>      
>> Wow, I feel your pain, the runtime of that method is quite brutal for
>> large packages...
>>
>> Find attached a somewhat faster (but still slow) implementation.
>>
>> Test:
>> findTime := [unsent := SystemNavigation default
>> unsentMessagesInPackageNamed: 'Morphic'] timeToRun
>>
>> Numbers on my machine:
>> Current:
>> findTime - 29 minutes, 35 seconds.
>> unsent size - 531
>>
>> Attached:
>> findTime - 3 minutes, 9 seconds.
>> unsent size - 531
>>
>> Cheers,
>> Henry
>> <UnsentTesting.1.cs>_______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>    
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
>  

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Henrik Sperre Johansen
With test* methods removed, here's the list, as well as # per package.
(2482 total)

Cheers,
Henry

Den 05.02.2010 15:18, skrev Henrik Johansen:

> You can now do
>
> findTime := [unsent := SystemNavigation default
> unsentMessagesInPackageNamed: '*'] timeToRun
>
> in the time it used to take for Morphic alone. (about 30 mins)
> That's the entire system btw, 7486  unsents in my core image ;)
>
> Cheers,
> Henry
>
>
> Den 05.02.2010 14:11, skrev Stéphane Ducasse:
>  
>> [update 1.1] #11196
>> 11196
>> -----
>>
>> - faster isUnsentMessage: tx Henrik
>>
>>
>>
>>
>>
>> On Feb 5, 2010, at 1:54 PM, Henrik Johansen wrote:
>>
>>  
>>    
>>> Den 05.02.2010 11:15, skrev Laval Jannik:
>>>    
>>>      
>>>> Hi all,
>>>>
>>>> I have used SystemNavigation>>unsentMessagesInPackageNamed:
>>>> on the package Morphic.
>>>>
>>>>      
>>>>        
>>> Wow, I feel your pain, the runtime of that method is quite brutal for
>>> large packages...
>>>
>>> Find attached a somewhat faster (but still slow) implementation.
>>>
>>> Test:
>>> findTime := [unsent := SystemNavigation default
>>> unsentMessagesInPackageNamed: 'Morphic'] timeToRun
>>>
>>> Numbers on my machine:
>>> Current:
>>> findTime - 29 minutes, 35 seconds.
>>> unsent size - 531
>>>
>>> Attached:
>>> findTime - 3 minutes, 9 seconds.
>>> unsent size - 531
>>>
>>> Cheers,
>>> Henry
>>> <UnsentTesting.1.cs>_______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>    
>>>      
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>>  
>>    
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
>  

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

unsent.txt (92K) Download Attachment
unsentPackages.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Mariano Martinez Peck
The problem is that this hasn't TOO much sense. I mean, is obvious that there will be a lot of messages not sent. And that's correct. That's the API the core shows to the rest of the world. Why should the core call all those methods too ?

To make this more accurate, maybe we should test the unsent  methods of the classes of the core image but in a Dev image for example.

Cheers

Mariano

2010/2/5 Henrik Johansen <[hidden email]>
With test* methods removed, here's the list, as well as # per package.
(2482 total)

Cheers,
Henry

Den 05.02.2010 15:18, skrev Henrik Johansen:
> You can now do
>
> findTime := [unsent := SystemNavigation default
> unsentMessagesInPackageNamed: '*'] timeToRun
>
> in the time it used to take for Morphic alone. (about 30 mins)
> That's the entire system btw, 7486  unsents in my core image ;)
>
> Cheers,
> Henry
>
>
> Den 05.02.2010 14:11, skrev Stéphane Ducasse:
>
>> [update 1.1] #11196
>> 11196
>> -----
>>
>> - faster isUnsentMessage: tx Henrik
>>
>>
>>
>>
>>
>> On Feb 5, 2010, at 1:54 PM, Henrik Johansen wrote:
>>
>>
>>
>>> Den 05.02.2010 11:15, skrev Laval Jannik:
>>>
>>>
>>>> Hi all,
>>>>
>>>> I have used SystemNavigation>>unsentMessagesInPackageNamed:
>>>> on the package Morphic.
>>>>
>>>>
>>>>
>>> Wow, I feel your pain, the runtime of that method is quite brutal for
>>> large packages...
>>>
>>> Find attached a somewhat faster (but still slow) implementation.
>>>
>>> Test:
>>> findTime := [unsent := SystemNavigation default
>>> unsentMessagesInPackageNamed: 'Morphic'] timeToRun
>>>
>>> Numbers on my machine:
>>> Current:
>>> findTime - 29 minutes, 35 seconds.
>>> unsent size - 531
>>>
>>> Attached:
>>> findTime - 3 minutes, 9 seconds.
>>> unsent size - 531
>>>
>>> Cheers,
>>> Henry
>>> <UnsentTesting.1.cs>_______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>>
>>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Marcus Denker-4

On Feb 5, 2010, at 3:51 PM, Mariano Martinez Peck wrote:

> The problem is that this hasn't TOO much sense. I mean, is obvious that there will be a lot of messages not sent. And that's correct. That's the API the core shows to the rest of the world. Why should the core call all those methods too ?
>
> To make this more accurate, maybe we should test the unsent  methods of the classes of the core image but in a Dev image for example.
>

What we need is to document the API... all methods that are part of the public API and unsent --> OK. All else--> delete.

        Marcus


--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Lukas Renggli
In reply to this post by Henrik Sperre Johansen
If I were you I would use the refactoring browser (load the latest
code, I just found and fixed a bug related to sent-messages
calculation) for that:

For Morphic this takes about 1 second on my system and finds over 600
unsent messages:

   rule := RBImplementedNotSentRule new.
   rule runOnEnvironment: (BrowserEnvironment new
       forPackageNames: #('Morphic'))

And for the complete system about 750 ms and finds over 4500 unsent
messages (not counting tests, because they are all unsent). Obviously
iterating through a package is the most expensive thing in this whole
process:

   rule := RBImplementedNotSentRule new.
   rule runOnEnvironment: BrowserEnvironment new
       forPackageNames: #('Morphic'))

To open a browser on the result evaluate:

   rule open

Note, that opening a browser on that many methods can is slow.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Stéphane Ducasse
Lukas

can you find the sender of + (which is inlined).



> If I were you I would use the refactoring browser (load the latest
> code, I just found and fixed a bug related to sent-messages
> calculation) for that:
>
> For Morphic this takes about 1 second on my system and finds over 600
> unsent messages:
>
>   rule := RBImplementedNotSentRule new.
>   rule runOnEnvironment: (BrowserEnvironment new
>       forPackageNames: #('Morphic'))
>
> And for the complete system about 750 ms and finds over 4500 unsent
> messages (not counting tests, because they are all unsent). Obviously
> iterating through a package is the most expensive thing in this whole
> process:
>
>   rule := RBImplementedNotSentRule new.
>   rule runOnEnvironment: BrowserEnvironment new
>       forPackageNames: #('Morphic'))
>
> To open a browser on the result evaluate:
>
>   rule open
>
> Note, that opening a browser on that many methods can is slow.

Why this is that slow in the image and not in RB.
because it does it at the AST level and not scanning all the bytecode?


>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Morphic cleaning

Lukas Renggli
> can you find the sender of + (which is inlined).

Yes, the refactoring browser takes these into account.

> Why this is that slow in the image and not in RB.
> because it does it at the AST level and not scanning all the bytecode?

No, reading the source is dead slow. As soon as you have to load the
source of each method you can go to the kitchen and fetch a coffee.

The algorithm in the image goes to every method and asks it for its
senders. Asking for the senders is expensive because it has to iterate
through each compiled method. Thus the whole search is O(n^2).

The refactoring engine first collects all sent messages in the system.
Then it checks for the presence of each method selector in this set.
Thus the whole search is O(n).

Similarly the refactoring engine can quickly find out if a method is
sent but nowhere implemented.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project