Streaming data in Oak #491
Replies: 1 comment
-
Ultimately, this is more of a Deno question than specifically an oak one. At the moment, Deno files use the Deno specific The change in performance you are experiencing has to do with how the stream is offered up in As far as speed issue, it is likely denoland/deno#13608 and/or denoland/deno#10157. |
Beta Was this translation helpful? Give feedback.
-
Hey guys,
First of all, I'd like to thank you for creating and maintaining oak - for the time that I've been using it, it has been nothing short of amazing.
This issue is aimed primarily to get some answers as to how things work with Oak, Deno, streams, and readers/writer.
Here is a sample of my code
Firstly, the client :
And secondly the server
Using this code, I'm able to transfer files between the two processes without any kind of problems, and that was my initial goal to start. But then I look at my RAM and I was surprised to say the least. This method eats through my RAM without any remorese.
But why thought, wasn't the intent of streamers to keep ram as free as possible while waiting on disk I/O?
So I tried chaning some stuff around and looking online for solutions, but this topic isn't too well documented and I also did not spend a vast amount of time hunting for answers since it was confusing to me anyway.
I tried a different setup - something like this:
The only change is that I'm doing
Instead of
And with this solution, my RAM is not being murdered 10 seconds into the transfer.
Why? What is different? Also could you please give a mild explanation to the difference in boody.ts line 320 to 347.
Side question: Is it possible to speed this up? I'm doing those tests between 2 lan pcs that have 10gb network with NVME cache and the speed is not more than 100mbs.
Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions