From owner-freebsd-gnome@FreeBSD.ORG Mon Feb 23 07:37:33 2009 Return-Path: Delivered-To: gnome@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C4DD106566B for ; Mon, 23 Feb 2009 07:37:33 +0000 (UTC) (envelope-from lioux@FreeBSD.org) Received: from goat.gigo.com (ipv6.gigo.com [IPv6:2001:470:1:18::2]) by mx1.freebsd.org (Postfix) with ESMTP id 811088FC12 for ; Mon, 23 Feb 2009 07:37:33 +0000 (UTC) (envelope-from lioux@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by goat.gigo.com (Postfix) with ESMTP id 60074658B for ; Sun, 22 Feb 2009 23:37:33 -0800 (PST) Received: from goat.gigo.com ([127.0.0.1]) by localhost (vette.gigo.com [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id vqARkmNxD9T0 for ; Sun, 22 Feb 2009 23:37:33 -0800 (PST) Received: from 189.74.32.106 (unknown [189.74.32.106]) by goat.gigo.com (Postfix) with ESMTPA id AA5495C20 for ; Sun, 22 Feb 2009 23:37:32 -0800 (PST) Received: (qmail 3786 invoked by uid 1001); 23 Feb 2009 04:37:14 -0300 Message-ID: <20090223073714.3700.qmail@exxodus.fedaykin.here> Date: Mon, 23 Feb 2009 04:37:14 -0259 From: Mario Sergio Fujikawa Ferreira To: gnome@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ZPt4rx8FFjLCG7dd" Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Subject: www/firefox3 Profile-Guided Optimization X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 07:37:34 -0000 --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 @@ -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--