-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading from stdin extremely slow #3281
Comments
any chance you can get more detailed timing (strace syscall whatever) to see where the time is being spent? thanks for maintaining the port! |
Just ran
Inspecting the trace file
So there's little activity apart from the single-byte reads.
Timing
First write (line 51562)
That's 0.189979 seconds for reading 8192 bytes, writing the 8k takes (0.106793 - 0.106883) 0.00009 seconds Comparing to using
The ktrace overhead is noticable but still completes in seconds
Reading 4k is 0.099876 Adding |
Ah, I think the issue is, exactly, here. What this does is to I don't know why we unbuffer stdin... or at least unconditionally. If was only done conditionally (if That's not the whole explanation, though. The full explanation lies here. As you may notice, we ask The solution would really be not to unbuffer stdin... |
Hi Richard, Thanks! Confirmed...
Doesn't make sense to call this |
I'd say that we should simply skip the call in |
- unbuffer causes single-byte reads from stdin and poor performance Fixes openssl#3281 CLA: trivial Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from openssl#3299) (cherry picked from commit 65d6248)
Hi,
A user reported performance issues on the FreeBSD port of OpenSSL 1.1.0e using
openssl enc
. Investigating the issue, I found that reading stdin was extremely slow compared to using-in
. This poor performance is not experienced with the 1.0.2 branch.For reference and build options
Created a 512M test file from /dev/zero named test.zero
Using openssl internal read/write
Using internal read and stdout
Using stdin and internal write (using dd so we have some statistics)
Tested with
-chacha20
as well with similar results.Thanks for a great product!
Bernard Spil
Maintainer OpenSSL ports in FreeBSD
The text was updated successfully, but these errors were encountered: