EventSource
EventSource copied to clipboard
event source polyfill performance issue in IE11
We are using below technologies in our Application,
- AngularJS
- .Net
- SSE
Application is compatible with Chrome browser. However to support in IE 11 and Edge browser we have included event source polyfill at client side. Below are our observation in IE 11 after including event source polyfill at client side.
- Performance is very low whlie loading the page in IE 11 compare to Chrome.
- When we do multiple client request, memory utilization is drastically increasing more than 1 GB (observed in task manager) and system is getting hang.
Please help us with below queries,
- event source polyfill is the reason to slow down the performance in IE 11 ?
- what are the disadvantages of event source polyfill in IE 11?
- Is there any other settings we need to do in IE 11 ?
Thanks, Bhaumik
How much data do you transfer inside of this connection?
With multiple request, data is in KBs (approximate 100 KB).
Seems, yes, it may have some performance problems
Edge supports fetch API with streaming response body. Probably it will work faster. I have a code for this polyfill to use it. But didn't test it.
@bhaumikbarad , please try a new version which uses Fetch API as a transport in Edge
Sorry to hijack this thread, but it feels like my issue may closely related. We're noticing that smaller message will come through, but certain messages do not. I'm at a loss as to what could possibly cause this. Is it possible that messages are too large and are being dropped altogether?
@adamtaylor13 , there is nothing in the source of the polyfill to drop large messages, it could be a bug or a browser bug in the underline browser APIs. What is the browser you are using and how large are the messages?
Holy speedy reply batman, well IE 11 is the browser that's giving me the issues. Turns out it's actually only about~24Kb so I'm actually a little surprised how small it was. It's so weird because certain messages get back absolutely fine, but for whatever reason, this call in particular chokes.
I'll also note that everything works fine in Chrome. (Typical)
would be nice to debug this - to see if it is a browser bug or a bug in the library
if it a browser bug - may be the progress
event is not fired like in #91 ,
timeout = setTimeout(function () {
onTimeout();
}, 0);
This code in the polyfill is trying to check xhr.responseText one more time to workaround this. May be, it is not good enough.
@adamtaylor13 , do you have a stream to reproduce? (with CORS headers preferably)
@Yaffle Sorry for the delay.. He's the most bizarre part of all of this. I was finding all this information out while testing on CrossBrowserTesting, but when I looked on BrowserStack—NO PROBLEM.
I cannot fathom what might be different between the 2 processes.
@adamtaylor13 , it seems, there is nothing I can do - the polyfill uses a timer to check XMLHttpRequest#responseText. Try in Edge.