You're right Mariano. However, I do not know if the help browser gets updated if you have a browser opened and add a new help in the system. In any case, this is a requirement that is not formalized by the unit tests.
I think that ideally, the reset cache should be done when receiving an event of a class creation that is a help. Alexandre On 30 Apr 2011, at 09:29, Mariano Martinez Peck wrote: > Cool! Thanks Alexandre. Now...the problem with the cache is always the > same...when to invalidate them. > In this case, when do I need to set helpTopicCache to nil. I guess that if > you create a help, then it is "automatically" detected when you open the > browser. > Now, you have to explicitly flush the cache, haven't you? So...is there some > documentation of HelpSystem that should be updated to reflect that ? > > Thanks > > On Sat, Apr 30, 2011 at 3:15 AM, Alexandre Bergel <alexandre.ber...@me.com> > wrote: > > 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: > > > 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 > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. > > > > > > > > > > -- > Mariano > http://marianopeck.wordpress.com > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.