We came across an odd issue. I did some searches and found some references, but nothing that explained it or how to work around it. Not sure if I should post in this forum or the Compiler/IDE one.
Boiling it down, it seems that anything to do with wxString usage, including parsing folders, wxXMLDocument, etc. slows down by a couple of orders of magnitude when the debugger is attached. Our IDE is Visual Studio 2012.
This isn't a release vs debug build issue, the debug build runs at normal speed when you launch outside the debugger.
Also, we are porting a large app that previously used MFC's CString's so it seems something related to the wxWidgets implementation of strings and the debugger in particular.
Does anyone know if there is something we can turn off in the debugger? Or something that can be switch off in the debug build of wxWidgets? The wxXMLDocument slow down in particular makes it very hard to run our app with the debugger attached.
Thank you!
- Alejandro
String related slow with debugger attached Topic is solved
Re: String related slow with debugger attached
I'm working with Visual Studio almost exclusively since VS2003 and never had this issue, so i can't give any solution.
Things i would try:
Check the watch window, check for conditional breakpoints, etc.
Build and run on a different PC, maybe the VS installation is just messed up somehow (which happens quite often).
On the wxWidgets side: Depending on whether your build uses STL strings or wxWidgets' own string implementation, try the other one.
Things i would try:
Check the watch window, check for conditional breakpoints, etc.
Build and run on a different PC, maybe the VS installation is just messed up somehow (which happens quite often).
On the wxWidgets side: Depending on whether your build uses STL strings or wxWidgets' own string implementation, try the other one.
Use the source, Luke!
Re: String related slow with debugger attached
You won't notice unless you are doing a lot with strings. The wxXMLDocumment is the one that makes it such a problem for us, the other ones aren't as critical. But you can also reproduce it with a simple benchmark app.doublemax wrote:I'm working with Visual Studio almost exclusively since VS2003 and never had this issue, so i can't give any solution.
Things i would try:
Check the watch window, check for conditional breakpoints, etc.
Build and run on a different PC, maybe the VS installation is just messed up somehow (which happens quite often).
On the wxWidgets side: Depending on whether your build uses STL strings or wxWidgets' own string implementation, try the other one.
Breakpoints, etc. wasn't the issue, and it's happening for everyone in the team (so that's several computers if you add PCs and laptops). I'll investigate changing string implementation and report back.
Thank you!
- Alejandro
Re: String related slow with debugger attached
Do you see 100% cpu load (at least on one core)?
Did you try profiling the app? Maybe you can see where it spends all the time.
Did you try profiling the app? Maybe you can see where it spends all the time.
Use the source, Luke!
Re: String related slow with debugger attached
Hi,
Are you attaching the debugger to the running application or you are trying to start the debug build of the application?
Is application MT? Does it have DLLs?
Which build of wx do you use - static or dynamic?
What SDK you are trying?
Do you use C++11?
Thank, you.
Are you attaching the debugger to the running application or you are trying to start the debug build of the application?
Is application MT? Does it have DLLs?
Which build of wx do you use - static or dynamic?
What SDK you are trying?
Do you use C++11?
Thank, you.
Re: String related slow with debugger attached
* I see a CPU spike, but not above 10%.doublemax wrote:Do you see 100% cpu load (at least on one core)?
Did you try profiling the app? Maybe you can see where it spends all the time.
* While the application writes the XML document it blocks and it seems to spend most of its time inside constructors for wxCharTypeBuffer
and wxScopedCharTypeBuffer doing memory allocation.
Haven't been able to test STL strings yet.
Thank you!
- Alejandro
Re: String related slow with debugger attached
Answers below. Thank you!ONEEYEMAN wrote:Hi,
Are you attaching the debugger to the running application or you are trying to start the debug build of the application?
Is application MT? Does it have DLLs?
Which build of wx do you use - static or dynamic?
What SDK you are trying?
Do you use C++11?
Thank, you.
0. Starting the debug build of the app from VS.
1. MDd and it does load multiple dlls
2. static
3. Not sure what you mean? As in Windows SDK?
4. No
Last edited by gul_garak on Wed Sep 05, 2018 6:26 pm, edited 1 time in total.
Re: String related slow with debugger attached
I found something that works around the issue: disabling the debug system heap. I think it doesn't affect our overall ability to debug our app so it solves this issue (I'll post again if I find any issues).
http://preshing.com/20110717/the-window ... -debugger/
https://stackoverflow.com/questions/336 ... with-debug
I'm pretty sure then that this has nothing to do with wxWidgets but for some reason it's particularly bad for wxWidgets string related operations vs the same using MFC CStrings.
Hopefully someone can use this for reference in the future if they find the same problem.
Thank you both for your help!
- Alejandro
http://preshing.com/20110717/the-window ... -debugger/
https://stackoverflow.com/questions/336 ... with-debug
I'm pretty sure then that this has nothing to do with wxWidgets but for some reason it's particularly bad for wxWidgets string related operations vs the same using MFC CStrings.
Hopefully someone can use this for reference in the future if they find the same problem.
Thank you both for your help!
- Alejandro