Search code examples
javascriptinternet-explorerkeystroke

IE not registering all keystrokes in JS heavy app


I am working on an app that is heavily JS and I have noticed that when typing in text boxes IE8 and IE7 (not seen in IE9 yet) randomly seems to pause for a fraction of a second and not register the key stroke. It does not seem linked to a specific character or length of string. I think that it is happening more if I type faster.

My suspicion is that the app has a JS framework that IE is struggling to keep a handle on and the keystrokes get lost in teh ether as IE is thinking about something else.

Using Process Explorer, I noticed that the app raises IE's RAM use to 165MB and whilst typing the CPU usage raises from 4% to 10%.

I have been through and tried to remove anything that is bound to key strokes for validation, shortcut capture etc. and it still happens.

Does is seem reasonable that the issue is just too much js in the application or has anyone come across issues with IE in this context and has another suggestion?

(edit)I have tested the application in Firefox 3.6 and Chrome and neither experience this issue.

Thanks for any help offered.


Solution

  • If you suspect JS processing, then you should see a significant difference between the app's performance in IE7 or 8 vs. IE9 (as IE9's JS performance is substantially sped up). You already see a significant difference in FF and Chrome which does support it being a JS performance issue.

    The things that might be causing it are most likely either originating on timer events or event handlers so it's worth searching for and temporarily disabling as much of that as you can find to see if you can find what's causing the lag.

    If all that fails, then you may need to use a JS profiler to find where all the time is going.