Why does my box2d.js/canvas script run faster with firebug open? - javascript

Seems truly bizarre, and I can't seem to find any cause.
I'm running a little simulation with box2d.js, just a few boxes with joints to make a 'rope'.
Using firefox (version 3.6.13) it runs quite sluggishly, until I open up firebug(version 1.6.0), and then there is a vast speed increace (at a guess I'd say at least 2x).
If I completely disable the firebug addon and restart the browser it remains slow.
What could be causing this, and how can I get it to run that fast normally?
EDIT
As proof, here is a zip file: https://docs.google.com/leaf?id=0B5twGxOv6WCsOTU5NzVjZTEtNGY0ZS00ZjFiLTkwNDUtYTE3YjlmNmU2Zjhh&sort=name&layout=list&num=50
Got a friend with an older version of firebug and he couldn't reproduce.
EDIT 2
If I change my implementation to using raphael instead of canvas it no longer occurs, so I think this must be to do with canvas.

That is bizarre! Do you have any console.log calls in your code? Without Firebug those will fail, perhaps causing the slow-down.

Related

Mysterious, unattributed things observed in DevTools profiling - what is this?

I was profiling my app for performance, when I started to notice something strange. A 'mousemove' event was firing and calling code I hadn't added myself. Heck, I don't have a mousemove listener on my page. I thought it might be an extension, maybe AdBlock, so I disabled all of my extensions. It didn't go away.
Also, upon opening a <select> list, I noticed it calling some class 'ListPicker'... Seriously, no clue where this is coming from. Some screenshots:
Also notice the "Compile Script"... I'm not eval-ing any script on my page by default. What gives? Looking for the source, DevTools simply says this:
Can I somehow still make DevTools redirect me to the exact lines of code it was executing? It is frustrating to see strange, alien code executed on one's page and not even being able to look at the source code.
More on the mousemove events it was firing:
Upon inspecting the sources tab, I found nothing but my own files.
In addition, I noticed that always somewhere towards the end of my profiling session, this "unattributed" source would appear to be completely blocking my JavaScript:
HOWEVER, this is not even what happens. My site stays completely responsive - it wouldn't do that with 100% scripting CPU usage. However DevTools says otherwise. The last thing that really gave me nightmares was this:
NEGATIVE SCRIPTING TIME? You can even see Chrome's rendering giving up towards the left of that pie chart.
So, in all my confusion, what exactly could this be? How do I find the source of this, or does it even have one, maybe this is just a bug within the newest version of Chrome? Really appreciate if anyone could drop their thoughts.

Firefox page load event very long

I'm going to try to explain an issue that scratch my head...
When I open this website for the first time after opening Firefox (v43.0.3), the UI freeze during about 20 seconds and I don't undersand why. For example you can see that the background image appear after almost 20 seconds...
So, I used firebug net panel to try to understand where the problem comes from and I notice that the page load event is very long but I can't see any tasks executing during this event.
here is a screenshot of firebug Net Panel
When I open the website with Chrome it works fine, does someone has ever encounter that kind of problem ?
I hope that makes sense, thank you in advance.
You're making 31 requests (according to my NET panel - FireBug) which add to 323ms (at least in my case). Your background image is loading ~1s after. Maybe if you'd try to reorganize all that sprites you're requesting into less files - but it seems fair as loading time for me.
I once had a problem with Firebug itself. I had to turn it off and\or uninstall to get the page load normally on Firefox.
In my case it was an effect of problem between Firebug and Telerik Kendo JS Library.
Maybe you have a problem similar issue.
Thanks for your answers, indeed it seem's to comes from my firefox configuration or addons/plugins.
I use a Firefox pre-configured by my socity, so I installed a portable firefox to try if it works and the website is loading normaly.
Now I just have to find from whitch config or addons/plugins the problem comes from, thanks again !

FireFox has stopped showing JS

Last night, I was trying to debug a particular bit of vanilla JavaScript on a private page.
After a half an hour or so, the browser crashed while in the middle of stepping through a troublesome section.
When FireFox restarted, FireBug insisted that there was no JavaScript on the page - does anyone have any ideas what is causing this? Clearly the JS was (nearly) valid before the crash, and wasn't changed before I restarted. The only thing I can see, is that FireBug probably installed an update at that point?
I've tried cutting out all of my code, but nothing seems to make a difference. Other pages, even on the same intranet site, still work, but this one doesn't list any files under the "Script" drop down.
I've compared with the built-in Dev tools, and they also show no JavaScript loaded. The JS is a form submission handler, and clearly it is no longer running when the form is submitted.
I struggled with this for much of today. Eventually resolved it by creating a new profile.
I would be very interested in learning of the root cause if anyone figures it out.

Why is IE8 rendering a page with JavaScript unusable while FF is doing fine?

LINK TO THE PAGE NO LONGER ACTIVE, THANKS FOR VISITING, Rene
Hi,
I have a page here and I can't understand why is IE8 rendering this page so slowly.
Originally I thought it was the scrolling text at the top but it's not as I commented it out with no progress. So then I profiled with developer tools for IE8 and it shows a lot of anonymous functions running which I suspect come from jquery (which is not loaded by me directly) but the developer tools cannot show me the source code for those functions. So I can't pin down the problem on what are those phantom functions running from or why as I have no experience with jquery. I noticed that those functions do not run in FF when I profiled it with FireBug so maybe something is running for IE but not for FF ? I am a bit lost.
Any help/suggestions is greatly appreciated!
Thanks so much,
Rene
I was able to see the process jumping between 79MB and 65MB off and on. It may be an issue of memory not being freed up or perhaps an inefficient background operation that is hanging everything up.
I would go with meder5's advice. I would comment any and all unnecessary code and start with the bare minimum and track performance till you find the bottleneck as you add pieces back in.
Hi I also tested in Chrome 8. Frankly, the page is neither fast in IE nor FF nor Chrome. But its relatively faster in FF and Chrome much than IE. I suppose it has something to do with the different mechanisms of FF/Chrome and IE use handling contents.
By the way, I appreciate that you guys can do very nice animation with javascript&jquery,

How do I overcome IE8 getting "stuck" in SCORM 4th Edition Compliance Test SX-05?

I am posting this in the off chance there is a SCORM expert out there that may have seen something similar.
Internet Explorer 8 gets "stuck" on step 14 of test case SX-05. Something doesn't trigger the continue. No amount of debugging and tracing reveals anything. It's as if the test case is "overwhelming" IE8's slow JavaScript engine. All other tests run fine in IE8. This one is quite complex, but there are others of similar complexity.
Install Chrome. No one can fix IE
Have you tried pausing the test before you get to SX-05, closing the browser and then resuming the test? That might help.
Are you sure it is an IE issue? We have successfully run the 4th Ed test suite many times without issue. If the test always stops at the exact same place, it seems unlikely that it is a resource issue. At what point does the execution stop?
This turned out to be rather obscure. Our LMS was writing a loading page to the content iframe before loading the actual SCO.
window.frames.contentFrame.document.open();
window.frames.contentFrame.document.write(html);
window.frames.contentFrame.document.close();
I changed the loading page to a static HTML page and everything chugged along fine. Modifying the document that way screws up some window events on Firefox and IE.

Categories