EventSource icon indicating copy to clipboard operation
EventSource copied to clipboard

event source polyfill performance issue in IE11

Open bhaumikbarad opened this issue 6 years ago • 12 comments

We are using below technologies in our Application,

  1. AngularJS
  2. .Net
  3. 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.

  1. Performance is very low whlie loading the page in IE 11 compare to Chrome.
  2. 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,

  1. event source polyfill is the reason to slow down the performance in IE 11 ?
  2. what are the disadvantages of event source polyfill in IE 11?
  3. Is there any other settings we need to do in IE 11 ?

Thanks, Bhaumik

bhaumikbarad avatar Mar 08 '18 07:03 bhaumikbarad

How much data do you transfer inside of this connection?

Yaffle avatar Mar 08 '18 08:03 Yaffle

With multiple request, data is in KBs (approximate 100 KB).

bhaumikbarad avatar Mar 08 '18 08:03 bhaumikbarad

Seems, yes, it may have some performance problems

Yaffle avatar Mar 30 '18 03:03 Yaffle

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.

Yaffle avatar May 21 '18 15:05 Yaffle

@bhaumikbarad , please try a new version which uses Fetch API as a transport in Edge

Yaffle avatar Aug 22 '18 18:08 Yaffle

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 avatar Feb 04 '20 20:02 adamtaylor13

@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?

Yaffle avatar Feb 04 '20 21:02 Yaffle

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)

adamtaylor13 avatar Feb 04 '20 21:02 adamtaylor13

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.

Yaffle avatar Feb 04 '20 21:02 Yaffle

@adamtaylor13 , do you have a stream to reproduce? (with CORS headers preferably)

Yaffle avatar Feb 09 '20 13:02 Yaffle

@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 avatar Feb 13 '20 20:02 adamtaylor13

@adamtaylor13 , it seems, there is nothing I can do - the polyfill uses a timer to check XMLHttpRequest#responseText. Try in Edge.

Yaffle avatar Feb 13 '20 20:02 Yaffle