I’m having a significant performance problem during a Sketchup Export in our application.
When Windows Defender is enabled, our export takes over 4 - 8x as long. I’ve run some profiling sessions, and it looks like the most time is being spent inside SUEdgeCreate, SUEntitiesAddEdges, and SUDrawingElementSetLayer.
Inside these functions, there is a lot of time being spent in the CRT functions _ioinit, and especially _fclose_nolock.
Since slapi.dll doesn’t come with debug symbols, this is as far as I’ve made it in attempting to diagnose the issue.
Is this a known issue with the Sketchup Export functions, or a problem with Windows Defender? It seems quite odd that performance would degrade this badly. We have many, many users that will have this enabled by default, and it just torpedoes export performance.
Any chance you could share a sample C API code snippet with us where you see this? And comment which lines you see it? Just so we are 100% sure we are looking at the same thing.
I think you may be right about the MS re-brand, but I’m not certain about that one off hand.
As to the code, we’re really not doing anything extraordinary - more or less following the examples by the book. When defender is enabled, each function takes the same % of the total CPU time as before, it’s just that the total time is quadrupled (sometimes worse).
Here’s a simple example - the last three lines are where the bulk of the time is spent:
One other thing I noticed is that when defender is not active, the number of samples taken in ioinit very roughly matched the number of samples in fclose_nolock (41.7 and 41.52% respectively) - when defender is enabled, this skews towards fclose_nolock (36.12 and 49.61% respectively).
Appreciate you bumping the internal issue - hope this information helps.
If I exclude my compiled exe in the Windows Defender settings (under excluded processes) then the problem goes away, so there must be some issue with the real-time scanning. This is on Windows 8.1, which I think comes with Windows Defender installed by default.