<div dir="ltr"><div dir="ltr">On Fri, Aug 23, 2019 at 6:23 AM Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 23 Aug 2019, Marcel Taeumel wrote:<br>
<br>
> Hmm... HierarchyBrowser has a cache in #classList. Browser has no such cache. Browser >> #hierarchicalClassList is slow.<br>
> Also, class compilation is so slow because of SmalltalkImage >> #logChange:.<br>
<br>
I'm not sure that's true. It seems to be more like a mismeasurement by the <br>
profiler. The following takes ~200ms on my machine (it should remove the <br>
spam from the changes file, but use at your own risk):<br>
<br>
| startPosition |<br>
startPosition := (SourceFiles at: 2) size.<br>
[ 10000 timesRepeat: [ Smalltalk logChange: 'test' ] ] timeProfile.<br>
(SourceFiles at: 2) truncate: startPosition.<br>
<br>
Also, #forceChangesToDisk's trick to force write-to-disk by closing and <br>
reopening the file won't work in modern OSes. They'll realize that you're <br>
reopening a file already in your process's cache, and will just provide <br>
you with the cached file without forcing the contents to be written to <br>
disk.<br>
We have #sync to actually force write-to-disk, but using that in <br>
#forceChangesToDisk will make the above snippet 250x slower (or more if <br>
your storage device is not that fast).<br>
<br></blockquote><div><br></div><div>Magma handles a similar issue in its need to #sync by doing it no more than every 5 seconds.</div><div><br></div><div> - Chris</div></div></div>