7 Replies Latest reply on Sep 26, 2013 7:12 AM by Nate Burr

    Sending URL requests

    Nate Burr

      I keep seeing large spikes in my swf trying to send a url request. But these only appear in Firefox in OSX. I haven't tested in windows. Chrome (pepper and regular) and safari both work fine.  Also see large spikes when using extrnal interface. Any ideas on how to work with these and perhaps some best practices?

       

      FunctionTotal Time (ms)
      Sending URL requests
      8495%
          URL request timestamp
          URL request: <some_url>

          URL request ID: 25

       

      FunctionSelf Time (ms)Total Time (ms)
                      ExternalInterface.call <static> (flash.external)
      00%
      97100%
                          ExternalInterface._evalJS <static> (flash.external)
      97100%
      97100%

       

       

      -nate

        • 1. Re: Sending URL requests
          jozefchutka Level 1

          I have the same issue with IE 9 64bit. Any ideas what is the source of this issue?

          Clipboard01.png

          I have something like 90 URLRequests:

           

          var context:LoaderContext = new LoaderContext(true);

          context.imageDecodingPolicy = ImageDecodingPolicy.ON_LOAD;

                     

          loader = new Loader;

          loader.load(new URLRequest(url), context);

                     

          var loaderInfo:LoaderInfo = loader.contentLoaderInfo;

          loaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete, false, 0, true);

          loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoaderError, false, 0, true);

          • 2. Re: Sending URL requests
            Michael J.A. Smith Adobe Employee

            Bear in mind that the number of concurrent requests per server that Flash can make is limited by the browser (most limit it to around 6, see here: http://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser). So I wouldn't be surprised to see a high overhead if you're making 90 requests.

             

            For the ExternalInterface issue in the original post, it's really browser dependent - it's the browser that executes JavaScript, and there can be big variations in JVM performance.

            • 3. Re: Sending URL requests
              jozefchutka Level 1

              Michael, I do not see any relation between concurrent-requests-per-server-limitation and flash player being idle for almost two seconds. Would you mind explain me please? Normaly when you load a regular webpage, there might be hundreds of requests being made and that does not block your browser either.

              • 4. Re: Sending URL requests
                Michael J.A. Smith Adobe Employee

                Sorry, I should have explained more clearly. The sending of URLRequests is very browser-specific, and has to go through the browser sandboxing for security reasons (ActiveX in the case of IE). Since you're sending so many concurrent requests, it could be that Flash Player is blocking on the sandbox API in IE9, which is why you're seeing this delay.

                 

                I would suggest reducing the number of concurrent requests, and see if this helps (in general, it's good practice to make as few requests as possible, to reduce latency. If a normal website is making hundreds of requests on loading, it hasn't been optimised properly.). If you can reproduce the blocking behaviour for a certain number of concurrent requests on IE9 only, then you could file a bug against Flash Player - although if it works fine with IE10, it's unlikely it'll get fixed.

                 

                At the end of the day, if you can only make 6 or so concurrent requests at the same time, it's pointless to try and send more - either reduce the number of requests (preferably), or wait for the first batch to finish before sending some more.

                • 5. Re: Sending URL requests
                  jozefchutka Level 1

                  Michael, thank you for your detailed answer. I accept your suggestion about the issue related to sandbox api in IE9. Reducing concurent requests helped and was necessary for smooth flow of my app. However I believe this is an issue that should be targeted on flash player level not app code... I will consider filing a bug

                   

                  I strongly disagree with your conclusion:

                  At the end of the day, if you can only make 6 or so concurrent requests at the same time, it's pointless to try and send more - either reduce the number of requests (preferably), or wait for the first batch to finish before sending some more.

                  http://forums.adobe.com/message/5714849#5714849 ... 92 requests

                  http://www.adobe.com/cz/ 117 requests

                  http://facebook.com 200 requests

                  http://maps.bing.com 100 requests in fullscreen mode when zooming, all of them concurrent ... this is basicaly what my app does

                  • 6. Re: Sending URL requests
                    Nate Burr Level 1

                    My url requests in the original post are all sequential. only one happens at a time. when the previous one ends. the next one begins.

                     

                    For me if i reboot my machine it seems to go away for a while. but if the machine has been on for several days is when i start noticing really high spikes.

                     

                    External interface is dispatched about every 4 seconds. it's a small string. maybe 20 characters. nothing that should slow down external interface.

                     

                    All of this only happens in firefox for me and still exists in the current version.

                    • 7. Re: Sending URL requests
                      Nate Burr Level 1

                      Even though those websites are loading 100+ requests. they aren't doing them all at once. they are still batched so that one loads after the other. Check out the loading graph in chrome developer.

                       

                      Most browsers are still limited to 6 tcp connections at once.