[Pharo-project] HelpBrowser takes too much time to open

Alexandre Bergel alexandre.bergel at me.com
Sat Apr 30 03:15:45 CEST 2011


> MessageTally time: [HelpBrowser open]   between 2 seconds in Cog and with a regular VM between 6 and 8....
> is there an easy way to improve it ?
> 
> Alexandre, do you want another place where to put a cache like Metacello's currentVersion?   ;)

:-)
Sure. Easy. 

SystemHelp>>allSystemHelpPragmas takes time. When you open a browser, the method HelpBrowser>>open is called once and SystemHelp>>allSystemHelpPragmas twice. Easy to suspect that a cache is missing.

So, if you define 
-=-=-=-=-=-=-=-=-=
HelpBrowser>>helpTopic
	^ helpTopicCache ifNil: [ helpTopicCache := rootTopic asHelpTopic ]
-=-=-=-=-=-=-=-=-=

and adapt HelpBrowser>>refresh you win 50% of execution time.

Here is it:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HelpBrowserFix.1.cs
Type: application/octet-stream
Size: 998 bytes
Desc: not available
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110429/59ca9ebb/attachment.obj>
-------------- next part --------------

http://code.google.com/p/pharo/issues/detail?id=4126

Before this fix, I have:
[HelpBrowser open] timeToRun 
=> 6099

After the fix I have:
[HelpBrowser open] timeToRun 
=> 3094

Naturally, tests are kept green.

Cheers,
Alexandre

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.







More information about the Pharo-project mailing list