Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Feb 2009 04:37:14 -0259
From:      Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
To:        gnome@FreeBSD.org
Subject:   www/firefox3 Profile-Guided Optimization
Message-ID:  <20090223073714.3700.qmail@exxodus.fedaykin.here>

next in thread | raw e-mail | index | archive | help

--ZPt4rx8FFjLCG7dd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

	I thought we should consider adding an OPTIONS entry to
allow building firefox3 with Profile-Guided Optimization.

	The firefox3 build toolchain supports it out of the box as
mentioned on

https://developer.mozilla.org/en/Building_with_Profile-Guided_Optimization

and this should yield a massive performance improvement.

	I began a patch for the www/firefox3 port. Add

mozconfig-profile_guided_optimization.in

to FILESDIR. Then, apply the attached patch to the port's Makefile.

	That is just a preliminary try out. It does not work yet.
According to the mozilla documentation, the pre-build target I added
(commented out) to the Makefile should do the job.

	However, the port currently uses the build toolchain through
the configure-stage-generated Makefiles which I cannot decipher
when trying to find a way to invoke the equivalent of

$ gmake -f client.mk profiledbuild

when WITH_PGO is defined.

	Does anyone have an idea on how to procceed?

	Regards,

-- 
Mario S F Ferreira - DF - Brazil - "I guess this is a signature."
feature, n: a documented bug | bug, n: an undocumented feature

--ZPt4rx8FFjLCG7dd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="mozconfig-profile_guided_optimization.in"

mk_add_options PROFILE_GEN_SCRIPT='@PYTHON@ $(OBJDIR)/_profile/pgo/profileserver.py'

--ZPt4rx8FFjLCG7dd
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename=patch

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/www/firefox3/Makefile,v
retrieving revision 1.12
diff -d -u -u -r1.12 Makefile
--- Makefile	11 Feb 2009 14:48:35 -0000	1.12
+++ Makefile	23 Feb 2009 06:39:37 -0000
@@ -53,6 +53,7 @@
 
 OPTIONS=	DBUS "Enable D-BUS support" on \
 		NEWTAB "Open external links in a new tab" on \
+		PGO "Enable Profile-Guided Optimization" off \
 		SMB "Enable smb:// URI support using gnomevfs" off
 
 .include <bsd.port.pre.mk>
@@ -72,10 +73,21 @@
 LIB_DEPENDS+=	dbus-glib-1.2:${PORTSDIR}/devel/dbus-glib
 .endif
 
+.if defined(WITH_PGO)
+USE_PYTHON_BUILD=	yes
+.include "${PORTSDIR}/Mk/bsd.python.mk"
+.endif
+
 .if ${ARCH} == "sparc64"
 BROKEN=		Does not compile on sparc64
 .endif
 
+profile-guided-optimization-enable:
+.if defined(WITH_PGO)
+	@${SED} -e 's|@PYTHON@|${PYTHON_CMD}|' \
+		<${FILESDIR}/mozconfig-profile_guided_optimization.in >> ${WRKSRC}/.mozconfig
+.endif
+
 post-extract::
 	@${SED} -e 's|@FIREFOX_ICON@|${FIREFOX_ICON}|' -e 's|@MOZILLA@|${MOZILLA}|' \
 		-e 's|@MOZILLA_NAME@|${MOZILLA_NAME}|' \
@@ -100,6 +112,13 @@
 	    ${LN} -s xptcinvoke_asm_sparc64_openbsd.s xptcinvoke_asm_sparc64_freebsd.s)
 .endif
 
+post-configure: profile-guided-optimization-enable
+
+#pre-build:
+#.if defined(WITH_PGO)
+#	@cd ${WRKSRC} && ${GMAKE} -f client.mk profiledbuild
+#.endif
+
 port-pre-install:
 #	${SED} -e 's|1.9a7|0|' ${WRKSRC}/dist/bin/application.ini ${FAKEDIR}/lib
 	${ECHO_CMD} 'share/applications/${MOZILLA}.desktop' >> ${PLISTF}

--ZPt4rx8FFjLCG7dd--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090223073714.3700.qmail>