Open furkanusta opened 2 years ago
Damn, that is brutal. Thanks for reporting.
Alas, the now-in-retrospect insanity of relying on UNIX pipes to promptly transmit bytes to the curl process originates from #202 . It's hard to imagine any emacs user having data worth stealing, but people tend to get sanctimonious about security holes, even if those obvious holes are rarely the ones black hats exploit (it's never the devil you know that ends up killing you).
I've recorded the slowdown in a test in c769cf3. Since most users use request.el
to pull, and the minority that pushes doesn't push 25MB, I'm content to let this performance bug percolate.
Sending a tar file (~25MB) in the request body took around ~7sec, while it was near instant in the curl process. Further investigation revealed that the bottleneck is process-send-region
Creating a temporary buffer and passing the location of that to curl reduced the execution time drastically. What I am doing looks like this.
Would you like me to create a pull request with a similar change applied to files parameter as well? I understand if you do not want to modify an already working code.