Open photopea opened 7 years ago
I can't confirm this to be true with me.
What browser (+version) & JS framework (if any) for XMLHttpRequest are you using, it may help the dev diagnose issues (if any).
I am using the latest Chrome 57.0.2987.133
I create XMLHttpRequest directly. var xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.responseType = "arraybuffer"; xhr.onload = ....; xhr.send();
I did not look into optimizing the speed that the server can send files. I suspect increasing the buffer sizes on both the reading file from disk, and the amount that gets written to the socket, would greatly increase the speed.
Right now it reads from disk in in 4096*16 bytes, and writes in chunks of 4096 bytes. Each operation is asynchronous, so that could cause some slowdown.
I don't have time to test tweaking these values, but maybe one of you might try and test using different values and see what the possible speed increase would be.
https://github.com/kzahel/web-server-chrome/blob/master/handlers.js#L79 https://github.com/kzahel/web-server-chrome/blob/master/stream.js#L94
Seems like this may be the reason of the problem. Sadly, I don't have any experience with the development of Chrome extensions. Can anybody else try to change it?
I'll have a wee looksie.
Any news? Did changing the chunk size help? :)
Also it might be useful to test using https://chrome.google.com/webstore/detail/connection-forwarder/ahaijnonphgkgnkbklchdhclailflinn proxy'ing to nginx to see how fast data can flow through this app (which also uses chrome.sockets)
Since I need to locally stream mp4 files, for testing, I did some tests: With the default values, around 1mbyte/s is archived, using instead values with factor*1024, around 100mbyte/s is possible, without any further changes.
@empirephoenix Thanks! I have no experience with creating browser extensions. Can you send me your version, please? Or fork it and put it on Chrome Webstore separately, and send me the link. Thanks!
Can you update it, so it is faster, please?
When my local webpage loads a local file (XMLHttpRequest) through your server, it is very slow
A 180 MB file takes 40 seconds to load. It is 4.5 MB/s. I have an SSD drive and I believe, that higher speed is possible. The same file is opened much faster, when I open it through an <input type="file" .