搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

FileReader and FileReaderSync API's are slow

  • 1 回覆
  • 1 有這個問題
  • 1 次檢視
  • 最近回覆由 pkessing

more options

Hi I discovered this issue while using a customer facing HTML5 application. Our application requires that the browser reads a section of a file and then sends that section to a server via a websocket connection. Our application’s speed appeared to be browser dependent which led me and another team to write an application to test the speed of each browser. I have attached the data and graphs which clearly show that the Firefox Browser has a dramatically slower Synchronous and Asynchronous File Read functionality.

This data was collected by using the FileReader & and FileReaderSync API's. Our test app sliced a file into different chunks and read the entire file, one chunk at a time (using different chunksizes). I measured how long it would take to read a 25MB file and that time was used to calculate the file read rate in MBPS. When compared to Microsoft’s IE and Edge browsers, Firefox performed much worse when running the exact same code. It appeared to me while running my tests that Firefox throttles a particular thread that is taking too long to complete something. This conclusion was reached because the read rate starts at 1+ megabytes per second for the first few seconds and then quickly lowers into the hundreds or tens of kilobytes per second. This means that Firefox is not able to be used for running our application as we are trying to transfer files much bigger than 25MB which takes a very long time to complete!

Hi I discovered this issue while using a customer facing HTML5 application. Our application requires that the browser reads a section of a file and then sends that section to a server via a websocket connection. Our application’s speed appeared to be browser dependent which led me and another team to write an application to test the speed of each browser. I have attached the data and graphs which clearly show that the Firefox Browser has a dramatically slower Synchronous and Asynchronous File Read functionality. This data was collected by using the FileReader & and FileReaderSync API's. Our test app sliced a file into different chunks and read the entire file, one chunk at a time (using different chunksizes). I measured how long it would take to read a 25MB file and that time was used to calculate the file read rate in MBPS. When compared to Microsoft’s IE and Edge browsers, Firefox performed much worse when running the exact same code. It appeared to me while running my tests that Firefox throttles a particular thread that is taking too long to complete something. This conclusion was reached because the read rate starts at 1+ megabytes per second for the first few seconds and then quickly lowers into the hundreds or tens of kilobytes per second. This means that Firefox is not able to be used for running our application as we are trying to transfer files much bigger than 25MB which takes a very long time to complete!

所有回覆 (1)

more options

Here is the graph of the data I collected.