Our application write a lot of logs using simple AssignFile/Append/WriteLn/CloseFile routines. Everything worked just fine for a long time. But today we started to experience performace issues.

Our application write a lot of logs using simple AssignFile/Append/WriteLn/CloseFile routines. Everything worked just fine for a long time. But today we started to experience performace issues.

The results of quick investigation showed us the problem is that Windows Defender scans our log file constantly. And if I add an exclusion for *.log files in its settings, everything is fine again.

Perhaps MS pushed an update last night. I just wonder if anybody else has this issue?

Comments

  1. "Have you turned off any AV software?" is always the question following after "Have you tried turning it off and on again?" :D

    ReplyDelete
  2. This is what I hate about MS security patches. They reset everything without your knowledge or permission.

    ReplyDelete
  3. Will writing within a TThread or using TTask.Run() make any difference ? We have our own hand carved debug logger and it writes from inside a TTask.Run and we have no problems at all

    ReplyDelete
  4. Have a dedicated thread to write to the log. Queue messages to that thread, and let it write the messages in order. The logging thread holds the file open, and doesn't keep opening and closing the file. File needs to be opened with sharing to allow other parties to read.

    ReplyDelete
  5. David Schwartz sounds about right to me. The only differences between yours and ours is we use ppl and we open and close every time ( a bit inefficient I know )

    ReplyDelete
  6. Using a memory write cache, and a background thread that pulse out the contents every .5 seconds.

    ReplyDelete

Post a Comment