Jared D. McNeill schrieb:
On a 266MHz Geode GX:
$ time make show-var VARNAME=PKGNAME
gnome-control-center-2.22.2.1
1268.48s real 815.57s user 356.51s system
This is a joke, right?
Unfortunately, it is a very bad and true joke. One of the reasons is
that the buildlink3.mk files are loaded and parsed over and over:
$ strace | grep open | sort | uniq -c | sort -nr
21021 open("../../mk/bsd.fast.prefs.mk",
5572 open("../../x11/xproto/buildlink3.mk",
4505 open("../../converters/libiconv/buildlink3.mk",
2445 open("../../x11/kbproto/buildlink3.mk",
2443 open("../../x11/libXdmcp/buildlink3.mk",
2443 open("../../x11/libXau/buildlink3.mk",
2443 open("../../x11/libX11/buildlink3.mk",
2302 open("../../mk/buildlink3/find-libs.mk",
2302 open("../../mk/buildlink3/find-files.mk",
2302 open("../../mk/buildlink3/bsd.builtin.mk",
2216 open("../../devel/gettext-lib/builtin.mk",
2210 open("../../devel/gettext-lib/buildlink3.mk",
1905 open("../../devel/zlib/buildlink3.mk",
1631 open("../../graphics/freetype2/buildlink3.mk",
1335 open("../../mk/pthread.buildlink3.mk",
1248 open("../../textproc/expat/buildlink3.mk",
1167 open("../../devel/pcre/buildlink3.mk",
1167 open("../../devel/glib2/buildlink3.mk",
We could surely avoid that by changing _all_ these files to the order
known from C header files:
.ifndef BUILDLINK3_PKGNAME_MK
.define BUILDLINK3_PKGNAME_MK
.include "../../dependency/one/buildlink3.mk"
.include "../../dependency/two/buildlink3.mk"
BUILDLINK_PACKAGES+= pkgname
...
.endif
That would be all. But this change involves lots of subtleties that only
jlam@ understands. I asked some years ago whether to make that change,
but didn't dare to start the whole work.