[Help-gnutls] Performance of gnutls_record_recv(session, &c, 1)?

Martin Lambers marlam at marlam.de
Mon Mar 3 20:44:26 CET 2008

Hi all,

Dimitrios Apostolou reported a large performance difference between the
OpenSSL and GnuTLS versions of mpop, a POP3 client, when querying the
status of a large POP3 mail box (>70000 messages).

In this situation, mpop needs to read a large amount of data (size
listings and UIDs, but not the mails itself). This takes 1m15s with
GnuTLS and only about 15s with OpenSSL. The 1m15s are completely spent
at 100% CPU.

Mpop uses gnutls_record_recv(session, &c, 1) for reading the data, i.e.
it reads the characters one at a time. It does not do any buffering
because the TLS library needs to do buffering internally anyway.
The OpenSSL variant of mpop does the equivalent: SSL_read(ssl, &c, 1).

Can this performance difference be caused by different TLS session
parameters? If so, which parameters would that be? 
Should mpop perform additional buffering and read larger chunks of data
with gnutls_record_recv()?


More information about the Gnutls-help mailing list