socketio-file-upload
socketio-file-upload copied to clipboard
Benchmark
This lib is very similar to mine, I have tested the who side by side to see if there is any speed difference. It seems they are near identical in speed (for me ~4 megabytes a second uploaded), in my tests I am uploading over a 10gig network, I tried disabling the server from writing to file on both libraries and found that the speed did not change, my theory is that the client browsers file.slice > file.read* is the bottle neck.
Has anyone else looked into this? Is anyone getting much better than 3-4 MB/s ?
*I use 'readAsBinaryString', this lib uses 'readAsText' and 'readAsArrayBuffer' (I found no real speed difference between the 3 methods)
*My speed calcluation is:
/**
-
this get the time since the last push, scales the time and speed to per second values */
var timeNow = new Date(); if (File.lastTime) { var difference = timeNow.getTime() - File.lastTime.getTime(); var seconds = Math.floor(difference * 1000); var scale = 1 / seconds; var scaledSize = CHUNK_SIZE * scale; File.speed = scaledSize.toFixed(2) // <-- MB/s }
... //do slice & read file, etc.
File.lastTime = timeNow;