gdbgui icon indicating copy to clipboard operation
gdbgui copied to clipboard

UI is slow on Windows

Open AvivC opened this issue 5 years ago • 6 comments

Hello,

Please correct me if this isn't the right place to talk about this.

First I would like to say - the project is awesome, I was very glad to find it :)

On my Windows machine, running CPython 3.7 and using gdbgui to debug C programs, I'm having performance problems in the web GUI.

When stepping through the code (using n and s shortcuts), the commands may take 2-3 seconds (or more) to execute. This renders the program almost unusable.

I would like to ask if there is a known solution to this.

Thank you!

AvivC avatar Apr 05 '19 21:04 AvivC

Oh wow that's quite slow. Are you working with an exceptionally large stack or set of local variables?

cs01 avatar Apr 05 '19 21:04 cs01

No, the program is a pretty small one. Only a few stack frames and local variables.

Any ideas?

AvivC avatar Apr 05 '19 21:04 AvivC

I haven't used it with Python 3.7 but I wouldn't expect it to be slower than with Python 3.6. I also never use windows. The bottleneck is likely either the parsing of the gdb output (done on the backend in Python), or some sort of delay when polling for new gdb output. It is likely not rendering issues on the frontend since the browser should be consistent across platforms. The backend is where things may vary between linux and Windows. Are you using something like cygwin or mingw? Also, I sort of assumed your computer is decently powerful. Are you on an old computer? Are you running the gdbgui server remotely on a different computer? There could be network delays.

cs01 avatar Apr 05 '19 21:04 cs01

Yes, I'm using Mingw. Is there a way I can identify the bottleneck?

AvivC avatar Apr 05 '19 21:04 AvivC

You can log everything that is going on and see where the delay is.

On the frontend

  • log statements being sent to the backend: https://github.com/cs01/gdbgui/blob/master/docs/FAQ.md#how-can-i-see-what-commands-are-being-sent-to-gdb
  • Optionally open Chrome devtools and monitor network activity

On the backend

  • Run gdbgui --debug
  • Add a print statement whenever a command is sent to gdb: https://github.com/cs01/gdbgui/blob/master/gdbgui/backend.py#L359
  • Add a print statement whenever a response is read from gdb: https://github.com/cs01/gdbgui/blob/master/gdbgui/backend.py#L429

cs01 avatar Apr 05 '19 22:04 cs01

So today I launched gdbgui once again on the same program, and performance seems fine.

Yesterday the problems did start appearing only after a while. Maybe a memory leak or something?

Anyway, if this comes back I'll try to investigate and let you know. Thanks!

AvivC avatar Apr 06 '19 11:04 AvivC