Closed Bug 632344 Opened 12 years ago Closed 12 years ago

autoconf-2.13's AC_CHECK_HEADER is too slow for some headers e.g. atlbase.h


(Firefox Build System :: General, defect)

Windows XP
Not set


(Not tracked)



(Reporter: neil, Assigned: neil)



(Keywords: perf, Whiteboard: fixed-in-bs)


(1 file, 1 obsolete file)

For some reason, redirecting output to NUL: is painfully slow on Windows. Even on a fast machine I can only get a throughput of 150KB/s while by comparison redirecting to a file or a pipe is 6.5MB/s.

autoconf-2.61 works around this by allowing you to compile the test file rather than merely preprocess it. We can use this instead for nearly all of our checks. There is one file, oleacc.idl, that we check for but isn't really a header.
Attached patch Possible patch (obsolete) — Splinter Review
This patch only does boilerplate search/replace to; there are a number of places where the check is using AC_CHECK_HEADERS for one header or trying to pass a single-element list to AC_CHECK_HEADER or failing to use the optional parameters e.g. AC_CHECK_HEADERS([sdkddkver.h]) could probably become MOZ_CHECK_HEADER(sdkddkver.h, MOZ_WINSDK_MAXVER=0x06000000, MOZ_WINSDK_MAXVER=0x05020000).
Assignee: nobody → neil
Attachment #510561 - Flags: review?(ted.mielczarek)
Comment on attachment 510561 [details] [diff] [review]
Possible patch

>+    MOZ_CHECK_HEADER(event.h,
>+        [if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
>+            AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
>+        fi],
>+        AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
Whoops, my reindenting wasn't quite right. Sorry.
Comment on attachment 510561 [details] [diff] [review]
Possible patch

This looks fine. (Not that I feel qualified to review M4 macros!)

Does this impact the speed of the checks on Linux at all? We are caching them, so it's probably not a huge problem, but I'd hate to regress perf there while fixing Windows perf.
Attachment #510561 - Flags: review?(ted.mielczarek) → review+
I'd be willing to trade a little Linux perf for some Windows perf :-P
(In reply to comment #3)
> Does this impact the speed of the checks on Linux at all?
Well, I got the idea from autoconf-2.61, so they must have thought it was OK.
Attachment #510561 - Attachment is obsolete: true
Attachment #512628 - Flags: review+
With: 4min 13sec
Without: 4min 53sec

Can haz for 2.0?
No, but you can have right after.
Depends on: post2.0
Version: unspecified → Trunk
Whiteboard: fixed-in-build-system → fixed-in-bs
(In reply to comment #9)
It turns out that fcfreetype.h expects you to include fontconfig.h first.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.