Author Topic: Debugger becomes un-usably slow when using large-ish arrays  (Read 2750 times)

Offline AndyH

  • Dr. Type
  • ****
  • Posts: 383
    • View Profile
    • http://www.ovine.net/
I'm finding that when using arrays the debugger becomes unusable because it is so slow.

For exaggeration purposes, here is a large array:

DIM t[160][160]

Was thinking of using it to store a level 160 tiles across, 160 down - a lot of array elements.  The debugger upon pressing F10 to go to the next line will refresh the Variables panel in the editor each time and I guess is having to update each element in this array.  It can take a few seconds.

Can you optimise this?

Maybe only update the parts of the arrays that are expanded so you don't have to rebuild such large structures?  When the user clicks the + to expand a node in the array you could fetch the part required for that to help speed things up?

Jamagic's debugger (a long dead programming language) allowed an option in the project settings to force the debugger to show NO variables unless you placed some special debugger commands in your source to tell it to add a specific variable to the debugger watch list.  Maybe you could do something similar?

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10760
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Excellent idea. I have a project options variable, where you can specify maximum array size in debugger. Very clever.

Offline AndyH

  • Dr. Type
  • ****
  • Posts: 383
    • View Profile
    • http://www.ovine.net/
That works much better.  The good thing is, like types, I can just dump out contents of an array to the output window if needed, but you can still set it to show the first n number of elements too.

Thanks Gernot!