digitalnodecom / node-red-contrib-generic-s3

Generic S3 nodes for use in Node-RED
https://www.npmjs.com/package/@digitalnodecom/node-red-contrib-generic-s3
Apache License 2.0
3 stars 8 forks source link

very slow: stringify body flag with base64 encoding #51

Closed hoschult closed 1 year ago

hoschult commented 1 year ago

Hi, thanks for providing the new version with stringified body in base64 encoding. Tonight I checked the functionality and at least in my runtime this is terribly slow in response..... On the other side: utf8 encoded body works like charmed in terms of performance.

Do you have any ideas why base64 encoding is that slow in processing?

hoschult commented 1 year ago

I dig further into it and got the impression that the thread and/or the socket get stuck when using base64 encoding. Situation get even worse (in terms of performance) if you request several files to be downloaded in parallel.

It's no bandwidth issue (up/downstream of node red server tested with approx 50mb/s throughput) and also not an load issue (all cpus are in idle mode)

rristov60 commented 1 year ago

Hi @hoschult, I did some investigation by myself as well, I still haven't tried out the parallel downloads, but speaking purely utf-8 vs base64 encoding it is safe to say that performance differences are expected because they are used for different purposes and they perform different operations during the encoding process. Here is a quick sum up for this:

As for the thread and/or socket being stuck, please open a separate issue, just something to keep in mind is that this might be Node-RED specific and that tweaks about this on the node itself might not affect it. Although I believe it is a good feature to have GetObjects node which will allow the user to fetch a list of objects.

rristov60 commented 1 year ago

Hi @hoschult, since there is no new activity on the issue, I will close it. Feel free to reopen this issue if the above comment hasn't answered your question in a precise manner or if there is still some unclarity left. That being said, feel free to open a new issue at any time!