I/O with File plugin is slow The Next CEO of Stack OverflowLocal storage using OpenUI5 and Apache CordovaUpdate cordova plugins in one commandWhere is the location of file created by Cordova File Plugin?Phonegap/Cordova - Move audio file to the created directoryphone gap plugin in cordova projectAdd non Cordova-Plugin dependency to Cordova PluginPhoneGap Cordova plugin google maps - Plugin not definedWhy Cordova vibration plugin is not working?Cordova Status Bar Plugin hides the input when the keyboard appearsCordova plugin camera is working fine in developer app but not working after build the apk

Does the Brexit deal have to be agreed by both Houses?

How long to clear the 'suck zone' of a turbofan after start is initiated?

Customer Requests (Sometimes) Drive Me Bonkers!

If the heap is initialized for security, then why is the stack uninitialized?

The King's new dress

Can the Reverse Gravity spell affect the Meteor Swarm spell?

Implement the Thanos sorting algorithm

Anatomically Correct Mesopelagic Aves

Go Pregnant or Go Home

Should I tutor a student who I know has cheated on their homework?

How do we know the LHC results are robust?

Grabbing quick drinks

When Does an Atlas Uniquely Define a Manifold?

Can a single photon have an energy density?

Anatomically Correct Strange Women In Ponds Distributing Swords

How to make a software documentation "officially" citable?

How do I go from 300 unfinished/half written blog posts, to published posts?

Why did we only see the N-1 starfighters in one film?

Are there languages with no euphemisms?

Was a professor correct to chastise me for writing "Prof. X" rather than "Professor X"?

Trouble understanding the speech of overseas colleagues

How to start emacs in "nothing" mode (`fundamental-mode`)

Why doesn't a table tennis ball float on the surface? How do we calculate buoyancy here?

Only print output after finding pattern



I/O with File plugin is slow



The Next CEO of Stack OverflowLocal storage using OpenUI5 and Apache CordovaUpdate cordova plugins in one commandWhere is the location of file created by Cordova File Plugin?Phonegap/Cordova - Move audio file to the created directoryphone gap plugin in cordova projectAdd non Cordova-Plugin dependency to Cordova PluginPhoneGap Cordova plugin google maps - Plugin not definedWhy Cordova vibration plugin is not working?Cordova Status Bar Plugin hides the input when the keyboard appearsCordova plugin camera is working fine in developer app but not working after build the apk










0















I am currently working on an application that will receive and store several photos and videos in the local file system. (On average 40 photos and 10 videos per user)



To do this, I download the media from the server and then write it to the phone.



I feel like that the writing process is rather slow and I come to explain my problem to you to know if it is indeed an anomaly or if it is a correct time and that it is cordova or simply Android limitations.



To test the performance I created an empty cordova project so as not to distort the values because of the framework or other task that the application uses at the same time.



Here is the function that will write in the smartphone :



function write(blobObject) 
t0 = performance.now();
var path = cordova.file.externalApplicationStorageDirectory;
window.resolveLocalFileSystemURL(path, function (directoryEntry)
directoryEntry.getFile('toto.iso', create: true, exclusive: false , function (fileEntry)
fileEntry.createWriter(function (fileWriter)
var writed_size = 0;
var chunk_size = 0.25*1024*1024;

var writeChunk = () =>
fileWriter.onwrite = function()
if (writed_size < blobObject.size)
writeChunk();

else
t1 = performance.now();

;

if (writed_size)
fileWriter.seek(fileWriter.length);


var seeked_data = blobObject.slice(writed_size, writed_size + Math.min(chunk_size, blobObject.size - writed_size));

fileWriter.write(seeked_data);
writed_size += Math.min(chunk_size, blobObject.size - writed_size);


writeChunk();
);
, function() alert('error'););
);



Writing a 5MB file takes an average of 2385ms



Writing a 10MB file takes an average of 4774ms



Writing a 50MB file takes an average of 21867ms



Do you think it's my way of doing things that's wrong and if so, why?



Or as I think it's just limitations due to Cordova?



I'm testing from a Honor 6X.



Thank you very much for your help.










share|improve this question


























    0















    I am currently working on an application that will receive and store several photos and videos in the local file system. (On average 40 photos and 10 videos per user)



    To do this, I download the media from the server and then write it to the phone.



    I feel like that the writing process is rather slow and I come to explain my problem to you to know if it is indeed an anomaly or if it is a correct time and that it is cordova or simply Android limitations.



    To test the performance I created an empty cordova project so as not to distort the values because of the framework or other task that the application uses at the same time.



    Here is the function that will write in the smartphone :



    function write(blobObject) 
    t0 = performance.now();
    var path = cordova.file.externalApplicationStorageDirectory;
    window.resolveLocalFileSystemURL(path, function (directoryEntry)
    directoryEntry.getFile('toto.iso', create: true, exclusive: false , function (fileEntry)
    fileEntry.createWriter(function (fileWriter)
    var writed_size = 0;
    var chunk_size = 0.25*1024*1024;

    var writeChunk = () =>
    fileWriter.onwrite = function()
    if (writed_size < blobObject.size)
    writeChunk();

    else
    t1 = performance.now();

    ;

    if (writed_size)
    fileWriter.seek(fileWriter.length);


    var seeked_data = blobObject.slice(writed_size, writed_size + Math.min(chunk_size, blobObject.size - writed_size));

    fileWriter.write(seeked_data);
    writed_size += Math.min(chunk_size, blobObject.size - writed_size);


    writeChunk();
    );
    , function() alert('error'););
    );



    Writing a 5MB file takes an average of 2385ms



    Writing a 10MB file takes an average of 4774ms



    Writing a 50MB file takes an average of 21867ms



    Do you think it's my way of doing things that's wrong and if so, why?



    Or as I think it's just limitations due to Cordova?



    I'm testing from a Honor 6X.



    Thank you very much for your help.










    share|improve this question
























      0












      0








      0








      I am currently working on an application that will receive and store several photos and videos in the local file system. (On average 40 photos and 10 videos per user)



      To do this, I download the media from the server and then write it to the phone.



      I feel like that the writing process is rather slow and I come to explain my problem to you to know if it is indeed an anomaly or if it is a correct time and that it is cordova or simply Android limitations.



      To test the performance I created an empty cordova project so as not to distort the values because of the framework or other task that the application uses at the same time.



      Here is the function that will write in the smartphone :



      function write(blobObject) 
      t0 = performance.now();
      var path = cordova.file.externalApplicationStorageDirectory;
      window.resolveLocalFileSystemURL(path, function (directoryEntry)
      directoryEntry.getFile('toto.iso', create: true, exclusive: false , function (fileEntry)
      fileEntry.createWriter(function (fileWriter)
      var writed_size = 0;
      var chunk_size = 0.25*1024*1024;

      var writeChunk = () =>
      fileWriter.onwrite = function()
      if (writed_size < blobObject.size)
      writeChunk();

      else
      t1 = performance.now();

      ;

      if (writed_size)
      fileWriter.seek(fileWriter.length);


      var seeked_data = blobObject.slice(writed_size, writed_size + Math.min(chunk_size, blobObject.size - writed_size));

      fileWriter.write(seeked_data);
      writed_size += Math.min(chunk_size, blobObject.size - writed_size);


      writeChunk();
      );
      , function() alert('error'););
      );



      Writing a 5MB file takes an average of 2385ms



      Writing a 10MB file takes an average of 4774ms



      Writing a 50MB file takes an average of 21867ms



      Do you think it's my way of doing things that's wrong and if so, why?



      Or as I think it's just limitations due to Cordova?



      I'm testing from a Honor 6X.



      Thank you very much for your help.










      share|improve this question














      I am currently working on an application that will receive and store several photos and videos in the local file system. (On average 40 photos and 10 videos per user)



      To do this, I download the media from the server and then write it to the phone.



      I feel like that the writing process is rather slow and I come to explain my problem to you to know if it is indeed an anomaly or if it is a correct time and that it is cordova or simply Android limitations.



      To test the performance I created an empty cordova project so as not to distort the values because of the framework or other task that the application uses at the same time.



      Here is the function that will write in the smartphone :



      function write(blobObject) 
      t0 = performance.now();
      var path = cordova.file.externalApplicationStorageDirectory;
      window.resolveLocalFileSystemURL(path, function (directoryEntry)
      directoryEntry.getFile('toto.iso', create: true, exclusive: false , function (fileEntry)
      fileEntry.createWriter(function (fileWriter)
      var writed_size = 0;
      var chunk_size = 0.25*1024*1024;

      var writeChunk = () =>
      fileWriter.onwrite = function()
      if (writed_size < blobObject.size)
      writeChunk();

      else
      t1 = performance.now();

      ;

      if (writed_size)
      fileWriter.seek(fileWriter.length);


      var seeked_data = blobObject.slice(writed_size, writed_size + Math.min(chunk_size, blobObject.size - writed_size));

      fileWriter.write(seeked_data);
      writed_size += Math.min(chunk_size, blobObject.size - writed_size);


      writeChunk();
      );
      , function() alert('error'););
      );



      Writing a 5MB file takes an average of 2385ms



      Writing a 10MB file takes an average of 4774ms



      Writing a 50MB file takes an average of 21867ms



      Do you think it's my way of doing things that's wrong and if so, why?



      Or as I think it's just limitations due to Cordova?



      I'm testing from a Honor 6X.



      Thank you very much for your help.







      cordova cordova-plugins phonegap-plugins phonegap






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 21 at 16:40









      Enzo BLANCHONEnzo BLANCHON

      731317




      731317






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55285305%2fi-o-with-file-plugin-is-slow%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55285305%2fi-o-with-file-plugin-is-slow%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

          밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

          1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴