Knowledgebase: FAQ
Performance of my application becames very low if I enable EurekaLog!
Posted by Alexander Alexeev on 02 April 2009 11:12

Problem: 

My application runs significantly slower when I add EurekaLog to the project.

Reason:

EurekaLog can not slow down your application under normal circumstances - because EurekaLog is not active in your application almost all of the time. The only moments when EurekaLog becames active (and does its work) are:

  1. The exception is raised. Since EurekaLog does a lot of work for processing exception (collecting info, etc.) - the processing takes time. So, if your code raises a lot of exceptions - then this processing can slow you down. For example, if your code uses exceptions for notifications reasons (not as emergency mechanism as it should be);
  2. EurekaLog can decrease performance of your memory operations when memory features are enabled;
  3. EurekaLog can decrease performance of your application if you start/stop threads frequently and low-level hooks are enabled.
  4. EurekaLog monitors your primary thread when freeze detection feature is enabled;

Therefore a great decrease in application's performance usually means that you abuse exception system - in the sense that your code raising exception very frequently (possible in for/while/repeat-cycle) as its normal execution. Or if you are doing a lot of (small) memory allocations - instead of allocating a large buffer. Or if you are constantly starting threads - instead of using thread pools.

Solution:

If you have this performance problem only for a specific code area and you don't need to use EurekaLog for it. E.g. if you are using something like this:

try
  // your code
except
  // does nothing
end;

Then the easiest solution would be to disable EurekaLog for that code block:

SetEurekaLogStateInThread(0, False);
try
  // your code
finally
  SetEurekaLogStateInThread(0, True);
end;

However, if that is not the case - then you need to find out what is causing the performance loss:

  1. Try to disable memory features first;
  2. Try to disable freeze detection;
  3. Check how many exceptions does your code raises. Check if you have "Catch Handled exceptions" option enabled;
  4. Try to disable low-level hooks.

Depending on what your findings will be - you can:

  1. Try to use buffers or cache to decrease number of memory allocations. You can also disable memory tracking in EurekaLog;
  2. You can disable freeze detection;
  3. You can ignore specific exceptions and/or disable "Catch Handled exceptions" option;
  4. You can use thread pool instead of multiple thread workers.

Help Desk Software by Kayako Resolve