<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Eliot --<div><br></div><div>Since it is that easy for a user to add that exclusion ... yes, we might indeed check the performance of #forceChangesToDisk and give advice if it takes too long.</div><div><br></div><div>We had a similar discussion regarding #isLowerPerformance. A relative measurement would be nice. In this case, it would be like: "If writing to a new file takes this long, your #forceChangesToDisk should take that long."</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 02.12.2021 16:19:41 schrieb Eliot Miranda <eliot.miranda@gmail.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">Hi Marcel,<div dir="ltr"><br><blockquote type="cite" style="min-width: 500px">On Dec 2, 2021, at 5:31 AM, Marcel Taeumel <marcel.taeumel@hpi.de> wrote:<br><br></blockquote></div><blockquote type="cite" style="min-width: 500px"><div dir="ltr"><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Oh, this do-it seems to be enough to trigger the Windows Defender:<div><br></div><div>'</a>' size</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div><blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 02.12.2021 14:08:31 schrieb Marcel Taeumel <marcel.taeumel@hpi.de>:</p><div style="font-family:Arial,Helvetica,sans-serif"><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr"><div><span style="font-size: 13.3333px">Hi all --</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">Provided that you have a .changes file that is bigger than a couple of bytes (here: ~200 MiB), you might experience a serious lag (here: ~5 seconds) when:</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">- Starting the .image</span></div><div><span style="font-size: 13.3333px">- Evaluating some do-its (or print-its)</span></div><div><span style="font-size: 13.3333px">- Saving a method</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">All operations that typically read from or write to the .changes file.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">The Windows Defender's "real-time protection service" seems to monitor file access. Whatever triggers it, the defender might try to get exclusive read access to a file. Then it scans the last bytes and if it finds something strange, it will continue, eventually scanning THE ENTIRE FILE!</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">So, what is "something strange"? Well, try to evaluate this:</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">'<a href="https://</span>www.microsoft.com"></a>' size.</div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">Now, depending on the size of your .changes file, the Windows Defender will begin to scan the entire file for more such patterns. Note that the Defender will never complain or blacklist that file. It is just curious for the moment.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">Why is the Defender able to get exclusive read access on a do-it? Take a look at SmalltalkImage >> #forceChangesToDisk. There, you can see that we close and re-open the .changes file. That's exactly the time when the Windows Defender kicks in. Avoid closing that file, and you will not experience any lag.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">Try to save a method with such contents. You will be able to observe the same amount of extra lag.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">Why is regular read access during code browsing not affected? Because we already have the open file handle to the .changes and .sources files. The Defender seems to need exclusive read access. In my experience, this happened, for example, during VM/image startup.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">(Note that this has nothing to do with the Defender sending stuff to Microsoft via Internet. I did all the tests offline. No Ethernet connection. No WiFi.)</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">***</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">What can we do about it? Different approaches work:</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">- Save a method (or do-it sth.) to add about 1000 bytes of uninteresting content to the .changes file; then everything is fast again</span></div><div><span style="font-size: 13.3333px">- Shrink your .changes file via #condenseChanges (and don't forget to save your image afterwards!!) to speed up the Defender's scan</span></div><div><span style="font-size: 13.3333px">- Disable the "real-time protection service" in the Windows settings (not recommended)</span></div></div></div></blockquote></div></div></blockquote><div><br></div>Much better is to turn it off for a single file:<div><br></div><div><a href="https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26">https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26</a></div><div><br></div><div><span style="caret-color: rgb(77, 81, 86);color: rgb(77, 81, 86);font-family: Roboto, "Helvetica Neue", Arial, sans-serif;font-size: 18px;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);background-color: rgb(255, 255, 255)">Go to Start > Settings > Update & Security > Windows Security > Virus & threat protection. Under Virus & threat protection settings, select Manage settings, and then under Exclusions, select Add or remove exclusions. Select Add an exclusion, and then select from files, folders, file types, or process.</span></div><div><span style="color: #4d5156;font-family: Roboto, Helvetica Neue, Arial, sans-serif;font-size: 14pt"><span style="caret-color: rgb(77, 81, 86); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background-color: rgb(255, 255, 255);"><br></span></span></div><div><span style="color: #4d5156;font-family: Roboto, Helvetica Neue, Arial, sans-serif;font-size: 14pt"><span style="caret-color: rgb(77, 81, 86); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background-color: rgb(255, 255, 255);">(Me again) now what we really want is some check performed in Windows that checks Windows Defender’s settings, presumably the registry. eg if an operation on the changes file takes too long, or on startup, the image would check if it’s changes file is being monitored and would warn and/or prompt and/or offer to the user to set the exclusion.</span></span></div><div><span style="color: #4d5156;font-family: Roboto, Helvetica Neue, Arial, sans-serif;font-size: 14pt"><span style="caret-color: rgb(77, 81, 86); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background-color: rgb(255, 255, 255);"><br></span></span><blockquote type="cite" style="min-width: 500px"><div dir="ltr"><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr"><blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px"><div style="font-family:Arial,Helvetica,sans-serif"><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr"><div><span style="font-size: 13.3333px">- Avoid strange content in your source code (or do-its)</span></div><div><span style="font-size: 13.3333px">- Do not close the file so often. #primFlush: is not affected.</span></div><div><span style="font-size: 13.3333px"><br></span></div><div><span style="font-size: 13.3333px">Best,</span></div><div><span style="font-size: 13.3333px">Marcel</span></div></div></div></blockquote></div></div></blockquote></div><div><br></div><div>_,,,^..^,,,_ (phone)</div></div></blockquote></div>