Loading ...
Sorry, an error occurred while loading the content.

Re: [silvafug] Flex performance question (saving large data to a file)

Expand Messages
  • Henry Navarro
    We use the File class, since we are saving to a local file. I believe FileReference can only be used for remote files (virtual/physical). I didn t see the
    Message 1 of 7 , Apr 1 4:46 PM
    View Source
    • 0 Attachment
      We use the File class, since we are saving to a local file.  I believe FileReference can only be used for remote files (virtual/physical).  I didn't see the save() method from the language reference, btw.

      Henry

      On Fri, Apr 1, 2011 at 4:13 PM, tom s <tcs2201@...> wrote:
      Are you using an instance of the FileReference class to do the saving? The docs says it's non-blocking, and supported for 100MB.

      The FileReference.upload()FileReference.download()FileReference.load() and FileReference.save() functions are nonblocking. 

      These functions return after they are called, before the file transmission is complete 

      Are you listening to the progress and IOError events? If so, what are you hearing?
      Are you keeping the fileReference object in scope for the whole of the save process?

      If not, what are you doing?
      Send us code?

      tom



      On Thu, Mar 31, 2011 at 9:48 AM, Henry Navarro <hifromhenry@...> wrote:
       

      Hello,


      We have a scenario where about 100MB worth of bitmap data gathered by our Flex app from the web cam needs to be saved to a local file (no network delays involved, just I/O).  The data is first compressed down to about 30MB before being written to a file with a custom format.

      From our testing, saving 30MB takes about 30 seconds.  Since ActionScript is single-threaded, the Flex application is blocked (showing an our glass or some spinner) for that much time, and the user is unable to do anything with the app during this.  Hardware-based solution such as using solid state drives has been tried.  The option of creating a multi-threaded native process that will gather the web cam data and save to the file (with the Flex app's coordination) is being pursued as well.

      Is there a way to bring down the file save duration to 8 seconds or less? (8 being the approximate industry standard in UX design for keeping the user's attention, to my knowledge)
      Also interested if you think we may have reached the current limits of technology.

      Any inputs would be great.

      Thanks,
      Henry




    • Paul Robertson
      Also, if you re using the File class (in AIR) it has asynchronous versions of all its operations in addition to the synchronous versions. (If so you re
      Message 2 of 7 , Apr 4 8:21 AM
      View Source
      • 0 Attachment
        Also, if you're using the File class (in AIR) it has asynchronous versions of all its operations in addition to the synchronous versions. (If so you're probably using a FileStream object to do the saving so you would want to use FileStream.openAsync() to open the FileStream object; from there all the operations will run asynchronously.)

        Note that even if you're using asynchronous operations with the File/FileStream classes, those operations still run in the main thread, but they're just automatically broken up into chunks. (Sort of built in greenthreading I suppose.)

        I'm not sure whether the FileReference operations are the same as the async File operations or whether they run in a separate thread, but if I had to guess I'd say it's more likely the first one.

        Paul


        On 4/1/11 8:03 PM, tom s wrote:  

        p.s. - here is the reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#save()

        The file reference's save() method can be used to save a variety of data types from memory to local disk. 

        On Fri, Apr 1, 2011 at 5:44 PM, tom s <tcs2201@...> wrote:
        If you're using the File class then you must be creating an AIR app - are you? Or are you creating an web-app (that runs in the the Flash Player)?

        Are you listening to the progress and IOError events? If so, what are you hearing?

        tom



        On Fri, Apr 1, 2011 at 4:46 PM, Henry Navarro <hifromhenry@...> wrote:
        We use the File class, since we are saving to a local file.  I believe FileReference can only be used for remote files (virtual/physical).  I didn't see the save() method from the language reference, btw.

        Henry


        On Fri, Apr 1, 2011 at 4:13 PM, tom s <tcs2201@...> wrote:
        Are you using an instance of the FileReference class to do the saving? The docs says it's non-blocking, and supported for 100MB.

        The FileReference.upload()FileReference.download()FileReference.load() and FileReference.save() functions are nonblocking. 

        These functions return after they are called, before the file transmission is complete 

        Are you listening to the progress and IOError events? If so, what are you hearing?
        Are you keeping the fileReference object in scope for the whole of the save process?

        If not, what are you doing?
        Send us code?

        tom



        On Thu, Mar 31, 2011 at 9:48 AM, Henry Navarro <hifromhenry@...> wrote:
         

        Hello,


        We have a scenario where about 100MB worth of bitmap data gathered by our Flex app from the web cam needs to be saved to a local file (no network delays involved, just I/O).  The data is first compressed down to about 30MB before being written to a file with a custom format.

        From our testing, saving 30MB takes about 30 seconds.  Since ActionScript is single-threaded, the Flex application is blocked (showing an our glass or some spinner) for that much time, and the user is unable to do anything with the app during this.  Hardware-based solution such as using solid state drives has been tried.  The option of creating a multi-threaded native process that will gather the web cam data and save to the file (with the Flex app's coordination) is being pursued as well.

        Is there a way to bring down the file save duration to 8 seconds or less? (8 being the approximate industry standard in UX design for keeping the user's attention, to my knowledge)
        Also interested if you think we may have reached the current limits of technology.

        Any inputs would be great.

        Thanks,
        Henry






      • Henry Navarro
        Thanks, Tom and Paul for the tips. I ll have my team look into this. It appears the bottleneck was the data compression routine, but we will also optimize on
        Message 3 of 7 , Apr 4 11:13 AM
        View Source
        • 0 Attachment
          Thanks, Tom and Paul for the tips.  I'll have my team look into this.

          It appears the bottleneck was the data compression routine, but we will also optimize on any available areas related to the file classes.

          Gratefully,
          Henry


          On Mon, Apr 4, 2011 at 8:21 AM, Paul Robertson <paulslists@...> wrote:
           

          Also, if you're using the File class (in AIR) it has asynchronous versions of all its operations in addition to the synchronous versions. (If so you're probably using a FileStream object to do the saving so you would want to use FileStream.openAsync() to open the FileStream object; from there all the operations will run asynchronously.)

          Note that even if you're using asynchronous operations with the File/FileStream classes, those operations still run in the main thread, but they're just automatically broken up into chunks. (Sort of built in greenthreading I suppose.)

          I'm not sure whether the FileReference operations are the same as the async File operations or whether they run in a separate thread, but if I had to guess I'd say it's more likely the first one.

          Paul




          On 4/1/11 8:03 PM, tom s wrote:
           

          p.s. - here is the reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#save()

          The file reference's save() method can be used to save a variety of data types from memory to local disk. 

          On Fri, Apr 1, 2011 at 5:44 PM, tom s <tcs2201@...> wrote:
          If you're using the File class then you must be creating an AIR app - are you? Or are you creating an web-app (that runs in the the Flash Player)?

          Are you listening to the progress and IOError events? If so, what are you hearing?

          tom



          On Fri, Apr 1, 2011 at 4:46 PM, Henry Navarro <hifromhenry@...> wrote:
          We use the File class, since we are saving to a local file.  I believe FileReference can only be used for remote files (virtual/physical).  I didn't see the save() method from the language reference, btw.

          Henry


          On Fri, Apr 1, 2011 at 4:13 PM, tom s <tcs2201@...> wrote:
          Are you using an instance of the FileReference class to do the saving? The docs says it's non-blocking, and supported for 100MB.

          The FileReference.upload()FileReference.download()FileReference.load() and FileReference.save() functions are nonblocking. 

          These functions return after they are called, before the file transmission is complete 

          Are you listening to the progress and IOError events? If so, what are you hearing?
          Are you keeping the fileReference object in scope for the whole of the save process?

          If not, what are you doing?
          Send us code?

          tom



          On Thu, Mar 31, 2011 at 9:48 AM, Henry Navarro <hifromhenry@...> wrote:
           

          Hello,


          We have a scenario where about 100MB worth of bitmap data gathered by our Flex app from the web cam needs to be saved to a local file (no network delays involved, just I/O).  The data is first compressed down to about 30MB before being written to a file with a custom format.

          From our testing, saving 30MB takes about 30 seconds.  Since ActionScript is single-threaded, the Flex application is blocked (showing an our glass or some spinner) for that much time, and the user is unable to do anything with the app during this.  Hardware-based solution such as using solid state drives has been tried.  The option of creating a multi-threaded native process that will gather the web cam data and save to the file (with the Flex app's coordination) is being pursued as well.

          Is there a way to bring down the file save duration to 8 seconds or less? (8 being the approximate industry standard in UX design for keeping the user's attention, to my knowledge)
          Also interested if you think we may have reached the current limits of technology.

          Any inputs would be great.

          Thanks,
          Henry







        Your message has been successfully submitted and would be delivered to recipients shortly.