Child pages
  • Debugger query handling
Skip to end of metadata
Go to start of metadata

Debugger is a powerful tool, that allows to collect various information about script being executed. However recently I was running a script, that needed to perform 133000 sql INSERT statements. Statements were very short, but handling each one by debugger took 7000 bytes of memory versus 48 bytes (145 times faster) with debugger disabled.

We usually keep debugger enabled for company's IP addresses on websites. This way client might not be having memory leak issue, but we, as developers, will.

To make both end users and developer happy I'm proposing to allow controlling debugger behavior at run time. This way even if debugger is enabled in general any of it's settings can be changed for any particular code piece.

1 Comment

  1. Here is how debugger processes an information from a script:

    1. during script run an information is added to a debugger storage
    2. after script ends information from storage is converted to human-readable form and written to an a file
    3. a mini-debugger report is added at the page bottom
    4. pressing F12 will open debugger report by doing an AJAX call to retrieve previously generated file

    To prevent such enormous memory leads we can actually store temporary info used for debugger report generation on disk instead of script memory. Then we can convert stored info from temporary format to human-readable only on demand, where user is requesting a debugger report to be shown.