views:

1116

answers:

3

Hello,

I am trying to debug my web app and i have realised that firebug is making it damn slow. Is there any reason for this? Are there any set of reasons like maybe long js file which cause this problem?

Thank you very much.

UPDATE Am developing a web-app which will be primarily used by developers. Now if I dont find out what exactly is making firebug make my website slow, I will have to display one of those ugly Gmail style warnings. :(

+8  A: 

Firebug is a debugger. It must inject itself into Firefox in various ways in order to provide you with information you would normally not have available to you. Use it for debugging, turn it off when you don't need it, turn off the features you don't need (network, script, console...) when you don't need them.

Shog9
I haven't found Firebug slow with the default features (basically just the DOM editor).
Matthew Flaschen
Right. By default, the debugger and network profiler (the two slowest parts) along with the console (which can slow things down if there are a lot of errors / warnings / log messages) are disabled - all you have is the DOM explorer, which only kicks in when you use it and has all the information it needs in the page itself.
Shog9
It doesn't _really_ slow down anything if you've got enought RAM I think. I personnally can't tell the difference on my current machine, but I could on my previous one.
marcgg
+5  A: 

Firebug is basically a nice Javascript debugger. It provides traditional debugging features, like breakpoints and the ability to watch values, but it also lets you dig in and explore DOM elements.

Ultimately, if you've got a very large site (in terms of client-side code and complexity) then yes, Firebug can be a burden. First of all, disable any Firebug features (console, net, etc) that you aren't using.)

The only real way to remedy this is to -try- and see if you can work on only a portion of the Javascript you need by temporarily removing some of the other code. Generally, this just isn't feasible, but there isn't much more you can do.

Tony k
+13  A: 

Firebug is pretty intense on the ram. Certain applications like gmail detect that firebug is opened and warn the user that they might have a slower experience than usual.

Just turn it off when you don't need it.

UPDATE Am developing a web-app which will be primarily used by developers.

EDIT: Based on what you edited, I remembered that article concerning firebug : http://blog.getfirebug.com/?p=124

In the new model, if you can see Firebug, then its active. If you can’t it’s not.

I guess the developers using your website can figure on their own that if they have firebug opened it will slow down the website, right? If not I suppose that you have no choice but detecting if FB is opened and display an error message.

This chunk of code could also help :

if (window.console && window.console.firebug) {
    /* firebug found! */
}

There is also a way to disable some functionnalities :

if (! ('console' in window) || !('firebug' in console)) {
    var names = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'];
    window.console = {};
    for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
}

I haven't tested it (found here : http://davidwalsh.name/how-to-sniff-firebug-disable)

Hope that helps

marcgg