Recent

Author Topic: [Solved] An exceptional case with Defender !  (Read 801 times)

loaded

  • Hero Member
  • *****
  • Posts: 632
[Solved] An exceptional case with Defender !
« on: August 25, 2022, 02:54:20 pm »
Hi All,
The operating system I use is windows 10, I do not use an external program as an antivirus. I just use windows defender.
Something I just realized;
Lazarus was running pretty slow with Defender on. Even if I add Lazarus to the exclusions section of Defender, the result does not change.
However, if I turn off Defender completely and disable it, Lazarus' compilation speed increases surprisingly close to 100%.
Now, I now turn off defender before every run for quick compilation.
Is there a way to run the same fast without turning off Defender?
I would be glad if you share your experience and experience. Respects.
« Last Edit: August 26, 2022, 07:05:27 am by loaded »
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

rvk

  • Hero Member
  • *****
  • Posts: 5017
Re: An exceptional case with Defender !
« Reply #1 on: August 25, 2022, 03:26:34 pm »
Lazarus was running pretty slow with Defender on. Even if I add Lazarus to the exclusions section of Defender, the result does not change.
What exactly did you add to the exclusion? (Folder, File or Process?)
And what exactly?

Only the lazarus directory. Or only the lazarus.exe?
What about the fpc.exe and ppcx64.exe (the actual compiler)?
What about the FPC directory?
What about the %temp%? (or is compiling to a saved directory also slow?)

(I see I don't have any exclusion for Lazarus/FPC and it works fine but that can be machine-dependent.)
« Last Edit: August 25, 2022, 03:44:34 pm by rvk »


440bx

  • Hero Member
  • *****
  • Posts: 3161
Re: An exceptional case with Defender !
« Reply #3 on: August 25, 2022, 03:59:41 pm »
FWIW, I experienced the problem mentioned by @loaded and, after putting the Lazarus _folder_ in Defender's exception list, there was a very noticeable improvement.

That said, the Win 7 installation (which is the one I normally use) is still noticeably more responsive.
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 SP1 64bit.

rvk

  • Hero Member
  • *****
  • Posts: 5017
Re: An exceptional case with Defender !
« Reply #4 on: August 25, 2022, 04:08:39 pm »
You can also run procmon.exe (from sysinternals/microsoft) and exclude everything but MsMpEng.exe via Filter > Filters > Create filter with process Name is MsMpEng.exe.

Then you can see what is scanned and you can exclude the ones you think are from Lazarus/FPC.
(I excluded my Lazarus folder but MsMpEng.exe still accessed lazarus.exe in that directory, so I'm not sure if that helps)
Excluding fpc.exe, lazarus.exe and ppcx64.exe as process name in Defender did work much better.

Thaddy

  • Hero Member
  • *****
  • Posts: 12208
Re: An exceptional case with Defender !
« Reply #5 on: August 25, 2022, 06:20:33 pm »
The obvious way it to report it to MS as false positive. When well documented, they usually take note.
That means:
- win version
- bitness
- compiler type
- compiler version
- example sourcecode
- example of an executable that fails under defender.

MS is not evil and usually coöperates (eventually) because they hate false positives just as much as you do.

As a side note: Defender is nowadays the preferred AV and security solution, not any third party solution, like in the olden days.
« Last Edit: August 25, 2022, 06:24:21 pm by Thaddy »
Manuals, manuals, manuals first.
You have incompetence and sheer incompetence.

rvk

  • Hero Member
  • *****
  • Posts: 5017
Re: An exceptional case with Defender !
« Reply #6 on: August 25, 2022, 06:45:51 pm »
The obvious way it to report it to MS as false positive.
There is no case (in this topic) of false positive (according to the opening post).
Just slowness during compile.

(Please read the opening post carefully)

loaded

  • Hero Member
  • *****
  • Posts: 632
Re: An exceptional case with Defender !
« Reply #7 on: August 25, 2022, 07:30:41 pm »
Thank you very much, rvk and sketch and 440bx and Thaddy, for your answers and experiences.

What exactly did you add to the exclusion? (Folder, File or Process?)

I had previously only added the lazarus folder. I also added the applications you wrote as a process after your message.
the result did not change.


MS is not evil and usually coöperates (eventually) because they hate false positives just as much as you do.

Master Thaddy, I do not agree with you here;
We have a saying, "Searching with Candles", I think it's called "have a hankering for" in English. I'm looking for Win 7.

I think we will have a close friendship with the defender application from now on. I've included the compile times for defender on and off below.  ;D
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8468
  • Debugger - SynEdit - and more
    • wiki
Re: An exceptional case with Defender !
« Reply #8 on: August 25, 2022, 09:28:58 pm »
I've included the compile times for defender on and off below.  ;D

Did you do a full build in both cases?
Otherwise the 2nd compile, will always be faster.

Also you should always (for each test of defender on/off) do 2 runs.
Disregard the first run. It only serves to make sure you got similar amounts of disk data read into any cache.
Then measure the 2nd run.

I did various builds of the entire IDE, and did not see any significant difference (I am on Win 10). But I may just be lucky (or unlucky, but not aware of it).



I don't know your setup.

Have you checked memory usage? My IDE uses about 500MB. So slowing down due to swapping is very unlikely.
On the other hand while debugging (based on debugging a large project, like the IDE itself), mem usage goes up to 1.7 GB. The OS may decide to swap, even if you have the memory.

As for disk speed as a cause....
AFAIK: For code completion files should be read once, the first time they are needed. After that, the IDE only checks if the files have changed. So after that it should be fast (except if your OS decides to use the swap file).

You may want to check, menu: Tools > Options: Environment > General: "Check for disk file changes via content rather than timestamp".
If that is set, it may take extra time. You may want to uncheck it.

For compiling files will always be read.
But existing ppu will be checked, and files will only be compiled if they changed since. (or if there dependencies changed)


Rather unlikely, but there always is the chance that there is interference from some package you installed.
Make a 2ndary install, and test the original IDE.

wp

  • Hero Member
  • *****
  • Posts: 10291
Re: An exceptional case with Defender !
« Reply #9 on: August 25, 2022, 10:50:59 pm »
Maybe I should report my observations on Win 11: I have several Lazarus installations, and all of them are in subfolders of C:\Lazarus. And all my projects are in a common folder d:\Prog_Lazarus. Both folders are on the white-list of the Defender, subfolders are included automatically. (I do not use a different virus scanner any more). Usually I do not see any oddities caused by the virus-scanner with one exception: the Lazarus start.

My observation is that when I start one of these Lazarus versions for the first time it takes about 10 seconds or so, until the IDE appears. When I exit the IDE and re-start it later it appears immediately. The same story with any other Lazarus version that I have: Delayed first start, immediate following starts. When I power down the PC and reboot the next day the same story repeats.

When I rebuild the IDE I have a new binary, and there is a delayed first start again, even if there was an immediate start before rebuilding the IDE.

I did not do any experiments with Defender, but I tend to attribute this behaviour to the Defender. Or is the IDE cached after the first start?

Is anybody else seeing such an initial slow start of the IDE on Windows? (On my Linux VMs, the IDE appears immediately).


loaded

  • Hero Member
  • *****
  • Posts: 632
Re: An exceptional case with Defender !
« Reply #10 on: August 26, 2022, 07:04:39 am »
Thank you very much, Martin_fr and wp, for your answers and experiences.
With the Process Explorer application, I detected the applications that Lazarus was running during compilation.
I identified ppc386.exe as the application causing the delay. Adding this application to the exclusions of Defender solved the problem.
Another very important problem for me has been solved.
I am very grateful to all of you. Respects.
« Last Edit: August 26, 2022, 07:31:49 am by loaded »
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

PascalDragon

  • Hero Member
  • *****
  • Posts: 4761
  • Compiler Developer
Re: An exceptional case with Defender !
« Reply #11 on: August 26, 2022, 08:49:08 am »
With the Process Explorer application, I detected the applications that Lazarus was running during compilation.
I identified ppc386.exe as the application causing the delay. Adding this application to the exclusions of Defender solved the problem.

That's why we said to add the Lazarus folder itself to the exceptions, because many applications are involved in building (lazarus.exe, fpc.exe, the specific platform compiler (in this case ppc386.exe), fpcres.exe, depending on your settings ld.exe) and any of these could cause a slow down due to defender.

loaded

  • Hero Member
  • *****
  • Posts: 632
Re: [Solved] An exceptional case with Defender !
« Reply #12 on: August 26, 2022, 09:13:15 am »
That's why we said to add the Lazarus folder itself to the exceptions, because many applications are involved in building (lazarus.exe, fpc.exe, the specific platform compiler (in this case ppc386.exe), fpcres.exe, depending on your settings ld.exe) and any of these could cause a slow down due to defender.
I've tried adding the Lazarus folder to exceptions before but it didn't help.  ;D
Putting everything aside, if we just add ppc386.exe to the exceptions, the compilation becomes very fast.
Looks like he's the striker of the Compilation operation.
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

 

TinyPortal © 2005-2018