En-/Decryption speed for large files (GnuPG and Gpg4win)

Ming Kuang ming at imkuang.com
Mon Jan 16 15:09:27 CET 2023


On Monday, January 16, 2023 9:02 AM, ángel wrote:
> On 2023-01-15 at 23:14 +0800, Ming Kuang via Gnupg-users wrote:
> > On Sunday, January 15, 2023 5:52 PM, Christoph Klassen wrote:
> > > When I was testing the decryption I also tried "gpg --decrypt
> > > test_file.gpg" (without output file) with the 10 GB file and it took 8
> > > minutes and 47 seconds. I was wondering why it took longer when GnuPG
> > > didn't need to create an output file.
> >
> > As far as I know, outputting text to the screen (like printf) is a very time
> > consuming operation, it will block you until all printing is complete.
> >
> > gpg --decrypt test_file.gpg without output file will print all the decrypted
> > contents on the screen, which may be the reason why it takes so long.
> 
> Generally speaking, I wouldn't consider printing to the screen "very
> expensive" (i.e. print if you need to), but if you need to output a lot
> of text, the other side (the terminal) will need to process and draw it
> into the screen (think on it as a pipe), which will be slow with lots
> of text or extremely long lines. Moreover, in Windows it will be
> processed to convert LF into CRLF, and then moved into the Terminal
> subsystem.

You are right, my reply might be a bit misleading, what really takes time 
is the operation of drawing content to the terminal, if the application tries 
to print but you don't let it display on the screen (e.g. redirecting output 
to a file or /dev/null), the time consumption will not be a problem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20230116/ee30ffac/attachment.sig>


More information about the Gnupg-users mailing list