summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Wilson <dw@botanicus.net>2017-11-08 13:40:34 -0800
committerDavid Wilson <dw@botanicus.net>2017-11-08 13:40:34 -0800
commit829db35b1a61f9642e9c9857ecd0d0a9bfde6029 (patch)
tree599b01bfa5b3edf5af1e9e320b0226a424c00653 /configure.ac
parentd2262ccb7b16a0290c741bfb4c75a8fb089af265 (diff)
Use fgets_unlocked and fgetc_unlocked if available.
Since mutt does not use threads, there is no reason it should use the locked variants of the FILE* IO functions. This checks if the unlocked functions are available, and if so enables them globally via mutt.h. Cuts load time for a 56k message, 1.8GB /var/mail mailbox from 14 seconds to ~6 seconds, since we avoid acquiring and releasing a mutex for every character of input read. Before: 0m14.376s 74.98% mutt libc-2.18.so [.] _IO_getc 11.87% mutt mutt [.] mbox_parse_mailbox 0.94% mutt [kernel.kallsyms] [k] copy_user_generic_string 0.83% mutt libc-2.18.so [.] __strchr_sse2 0.53% mutt libc-2.18.so [.] __memcpy_sse2 0.44% mutt libc-2.18.so [.] _int_malloc After: 6 seconds 68.92% mutt mutt [.] mbox_parse_mailbox 2.25% mutt [kernel.kallsyms] [k] copy_user_generic_string 1.73% mutt libc-2.18.so [.] __strchr_sse2 1.24% mutt libc-2.18.so [.] __memcpy_sse2 1.17% mutt libc-2.18.so [.] _int_malloc 0.87% mutt libc-2.18.so [.] __strspn_sse42
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac1
1 files changed, 1 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index a9c32068..8618ddc3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -333,6 +333,7 @@ AC_CHECK_HEADERS(sys/time.h sys/resource.h)
AC_CHECK_HEADERS(unix.h)
AC_CHECK_FUNCS(setrlimit getsid)
+AC_CHECK_FUNCS(fgets_unlocked fgetc_unlocked)
AC_MSG_CHECKING(for sig_atomic_t in signal.h)
AC_EGREP_HEADER(sig_atomic_t,signal.h,