KindDragon / vld

Visual Leak Detector for Visual C++ 2008-2015
https://kinddragon.github.io/vld/
GNU Lesser General Public License v2.1
1.01k stars 314 forks source link

VLD performance #55

Open reid-p opened 5 years ago

reid-p commented 5 years ago

This ones odd, VLD performance differs dramatically between my machine and a colleague's.

Both running the same version of windows, vld (2.5.1) and MSVC 2017 (15.8.1) My machine is a Intel i7-3840QM Theirs is a Intel i7-4810MQ

Similar reports are listed on the old site https://archive.codeplex.com/?p=vld "2.5.0 became much slower than 2.4.1 somehow." "CaptureContext::IsExcludedModule takes more than 90% of execution time in allocations."

Using one comments suggestion I rebuild vld using the following BOOL CaptureContext::IsExcludedModule() { return g_vld.isModuleExcluded((UINT_PTR)m_context.fp); }

Performance is now comparable and application performance with vld enabled is now about 6-7x faster. The VirtualQuery() call in GetCallingModule() seems to be the culprit.

Anyone have any thoughts as to why?

ludekvodicka commented 5 years ago

Any news about this issue?

mattdurak commented 3 years ago

Calling QueryVirtualMemoryInformation instead of VirtualQuery seems to perform much better, but it requires upgrading the platform target to Windows 10. I have a fork with that change here: https://github.com/mattdurak/vld/tree/v2.5.6