Bug 457949 - no need for Stopwatch r=bsmedberg
authorTaras Glek <tglek@mozilla.com>
Fri, 28 Aug 2009 11:03:51 -0700
changeset 32061 092a301bd48463e60d32e11496da857ba8ed263b
parent 32060 80d7e3df729eed0fa9df4acc36e8a50ae1be5649
child 32062 ad18d068d42ecdc8e56bcf61dc3e8db217c91ed9
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs457949
milestone1.9.3a1pre
Bug 457949 - no need for Stopwatch r=bsmedberg
config/autoconf.mk.in
configure.in
content/base/src/nsContentSink.cpp
content/base/src/nsContentSink.h
content/html/document/src/nsHTMLContentSink.cpp
content/xml/document/src/nsXMLContentSink.cpp
embedding/components/build/Makefile.in
gfx/src/Makefile.in
gfx/src/thebes/Makefile.in
js/src/config/autoconf.mk.in
js/src/configure.in
layout/base/nsPresShell.cpp
layout/build/Makefile.in
modules/libutil/Makefile.in
modules/libutil/public/Makefile.in
modules/libutil/public/nsTimer.h
modules/libutil/public/stopwatch.h
modules/libutil/src/Makefile.in
modules/libutil/src/stopwatch.cpp
parser/html/nsHtml5Parser.h
parser/htmlparser/src/Makefile.in
parser/htmlparser/src/nsParser.cpp
parser/htmlparser/src/nsParser.h
parser/htmlparser/src/nsParserModule.cpp
toolkit/library/libxul-config.mk
toolkit/toolkit-makefiles.sh
toolkit/toolkit-tiers.mk
view/src/nsViewManager.cpp
view/src/nsViewManager.h
xpfe/browser/src/nsBrowserInstance.cpp
xpfe/components/build/Makefile.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -100,17 +100,16 @@ MOZ_DEBUG_ENABLE_DEFS		= @MOZ_DEBUG_ENAB
 MOZ_DEBUG_DISABLE_DEFS	= @MOZ_DEBUG_DISABLE_DEFS@
 MOZ_DEBUG_FLAGS	= @MOZ_DEBUG_FLAGS@
 MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
 MOZ_DBGRINFO_MODULES	= @MOZ_DBGRINFO_MODULES@
 MOZ_EXTENSIONS  = @MOZ_EXTENSIONS@
 MOZ_IMG_DECODERS= @MOZ_IMG_DECODERS@
 MOZ_IMG_ENCODERS= @MOZ_IMG_ENCODERS@
 MOZ_JSDEBUGGER  = @MOZ_JSDEBUGGER@
-MOZ_PERF_METRICS = @MOZ_PERF_METRICS@
 MOZ_LEAKY	= @MOZ_LEAKY@
 MOZ_MEMORY      = @MOZ_MEMORY@
 MOZ_JPROF       = @MOZ_JPROF@
 MOZ_SHARK       = @MOZ_SHARK@
 MOZ_CALLGRIND   = @MOZ_CALLGRIND@
 MOZ_VTUNE       = @MOZ_VTUNE@
 MOZ_TRACEVIS    = @MOZ_TRACEVIS@
 DEHYDRA_PATH    = @DEHYDRA_PATH@
--- a/configure.in
+++ b/configure.in
@@ -6898,27 +6898,16 @@ MOZ_ARG_ENABLE_BOOL(reflow-perf,
 [  --enable-reflow-perf    Enable reflow performance tracing],
     MOZ_REFLOW_PERF=1,
     MOZ_REFLOW_PERF= )
 if test -n "$MOZ_REFLOW_PERF"; then
     AC_DEFINE(MOZ_REFLOW_PERF)
 fi
 
 dnl ========================================================
-dnl Enable performance metrics.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(perf-metrics,
-[  --enable-perf-metrics   Enable performance metrics],
-    MOZ_PERF_METRICS=1,
-    MOZ_PERF_METRICS= )
-if test -n "$MOZ_PERF_METRICS"; then
-    AC_DEFINE(MOZ_PERF_METRICS)
-fi
-
-dnl ========================================================
 dnl Enable code size metrics.
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(codesighs,
 [  --enable-codesighs      Enable code size analysis tools],
     _ENABLE_CODESIGHS=1,
     _ENABLE_CODESIGHS= )
 if test -n "$_ENABLE_CODESIGHS"; then
     if test -d $srcdir/tools/codesighs; then 
@@ -8000,17 +7989,16 @@ AC_SUBST(MOZ_EXTENSIONS)
 AC_SUBST(MOZ_IMG_DECODERS)
 AC_SUBST(MOZ_IMG_ENCODERS)
 AC_SUBST(MOZ_JSDEBUGGER)
 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
 AC_SUBST(MOZ_PLUGINS)
 AC_SUBST(ENABLE_EAZEL_PROFILER)
 AC_SUBST(EAZEL_PROFILER_CFLAGS)
 AC_SUBST(EAZEL_PROFILER_LIBS)
-AC_SUBST(MOZ_PERF_METRICS)
 AC_SUBST(GC_LEAK_DETECTOR)
 AC_SUBST(MOZ_LOG_REFCNT)
 AC_SUBST(MOZ_LEAKY)
 AC_SUBST(MOZ_JPROF)
 AC_SUBST(MOZ_SHARK)
 AC_SUBST(MOZ_CALLGRIND)
 AC_SUBST(MOZ_VTUNE)
 AC_SUBST(MOZ_XPCTOOLS)
--- a/content/base/src/nsContentSink.cpp
+++ b/content/base/src/nsContentSink.cpp
@@ -82,17 +82,16 @@
 #include "nsServiceManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsParserUtils.h"
 #include "nsCRT.h"
 #include "nsEscape.h"
 #include "nsWeakReference.h"
 #include "nsUnicharUtils.h"
 #include "nsNodeInfoManager.h"
-#include "nsTimer.h"
 #include "nsIAppShell.h"
 #include "nsIWidget.h"
 #include "nsWidgetsCID.h"
 #include "nsIDOMNSDocument.h"
 #include "nsIRequest.h"
 #include "nsNodeUtils.h"
 #include "nsIDOMNode.h"
 #include "nsThreadUtils.h"
@@ -1364,40 +1363,30 @@ nsContentSink::NotifyAppend(nsIContent* 
 {
   if (aContainer->GetCurrentDoc() != mDocument) {
     // aContainer is not actually in our document anymore.... Just bail out of
     // here; notifying on our document for this append would be wrong.
     return;
   }
 
   mInNotification++;
-
-  MOZ_TIMER_DEBUGLOG(("Save and stop: nsHTMLContentSink::NotifyAppend()\n"));
-  MOZ_TIMER_SAVE(mWatch)
-  MOZ_TIMER_STOP(mWatch);
-
+  
   {
     // Scope so we call EndUpdate before we decrease mInNotification
     MOZ_AUTO_DOC_UPDATE(mDocument, UPDATE_CONTENT_MODEL, !mBeganUpdate);
     nsNodeUtils::ContentAppended(aContainer, aStartIndex);
     mLastNotificationTime = PR_Now();
   }
 
-  MOZ_TIMER_DEBUGLOG(("Restore: nsHTMLContentSink::NotifyAppend()\n"));
-  MOZ_TIMER_RESTORE(mWatch);
-
   mInNotification--;
 }
 
 NS_IMETHODIMP
 nsContentSink::Notify(nsITimer *timer)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::Notify()\n"));
-  MOZ_TIMER_START(mWatch);
-
   if (mParsing) {
     // We shouldn't interfere with our normal DidProcessAToken logic
     mDroppedTimer = PR_TRUE;
     return NS_OK;
   }
   
 #ifdef MOZ_DEBUG
   {
@@ -1425,18 +1414,16 @@ nsContentSink::Notify(nsITimer *timer)
     FlushTags();
 
     // Now try and scroll to the reference
     // XXX Should we scroll unconditionally for history loads??
     ScrollToRef();
   }
 
   mNotificationTimer = nsnull;
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::Notify()\n"));
-  MOZ_TIMER_STOP(mWatch);
   return NS_OK;
 }
 
 PRBool
 nsContentSink::IsTimeToNotify()
 {
   if (!mNotifyOnTimer || !mLayoutStarted || !mBackoffCount ||
       mInMonolithicContainer) {
--- a/content/base/src/nsContentSink.h
+++ b/content/base/src/nsContentSink.h
@@ -57,17 +57,16 @@
 #include "nsHashKeys.h"
 #include "nsTArray.h"
 #include "nsITimer.h"
 #include "nsStubDocumentObserver.h"
 #include "nsIParserService.h"
 #include "nsIContentSink.h"
 #include "prlog.h"
 #include "nsIRequest.h"
-#include "nsTimer.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsThreadUtils.h"
 
 class nsIDocument;
 class nsIURI;
 class nsIChannel;
 class nsIDocShell;
 class nsICSSLoader;
@@ -394,19 +393,16 @@ protected:
 
   PRInt32 mInNotification;
   PRUint32 mUpdatesInNotification;
 
   PRUint32 mPendingSheetCount;
 
   nsRevocableEventPtr<nsNonOwningRunnableMethod<nsContentSink> >
     mProcessLinkHeaderEvent;
-
-  // Measures content model creation time for current document
-  MOZ_TIMER_DECLARE(mWatch)
 };
 
 // sanitizing content sink whitelists
 extern PRBool IsAttrURI(nsIAtom *aName);
 extern nsIAtom** const kDefaultAllowedTags [];
 extern nsIAtom** const kDefaultAllowedAttributes [];
 
 #endif // _nsContentSink_h_
--- a/content/html/document/src/nsHTMLContentSink.cpp
+++ b/content/html/document/src/nsHTMLContentSink.cpp
@@ -1623,27 +1623,19 @@ IsScriptEnabled(nsIDocument *aDoc, nsIDo
 
 nsresult
 HTMLContentSink::Init(nsIDocument* aDoc,
                       nsIURI* aURI,
                       nsISupports* aContainer,
                       nsIChannel* aChannel)
 {
   NS_ENSURE_TRUE(aContainer, NS_ERROR_NULL_POINTER);
-
-
-  MOZ_TIMER_DEBUGLOG(("Reset and start: nsHTMLContentSink::Init(), this=%p\n",
-                      this));
-  MOZ_TIMER_RESET(mWatch);
-  MOZ_TIMER_START(mWatch);
-
+  
   nsresult rv = nsContentSink::Init(aDoc, aURI, aContainer, aChannel);
   if (NS_FAILED(rv)) {
-    MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::Init()\n"));
-    MOZ_TIMER_STOP(mWatch);
     return rv;
   }
 
   aDoc->AddObserver(this);
   mIsDocumentObserver = PR_TRUE;
   CallQueryInterface(aDoc, &mHTMLDocument);
 
   mObservers = nsnull;
@@ -1687,18 +1679,16 @@ HTMLContentSink::Init(nsIDocument* aDoc,
   if (doc_root) {
     // If the document already has a root we'll use it. This will
     // happen when we do document.open()/.write()/.close()...
 
     NS_ADDREF(mRoot = static_cast<nsGenericHTMLElement*>(doc_root));
   } else {
     mRoot = NS_NewHTMLHtmlElement(nodeInfo);
     if (!mRoot) {
-      MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::Init()\n"));
-      MOZ_TIMER_STOP(mWatch);
       return NS_ERROR_OUT_OF_MEMORY;
     }
     NS_ADDREF(mRoot);
 
     NS_ASSERTION(mDocument->GetChildCount() == 0,
                  "Document should have no kids here!");
     rv = mDocument->AppendChildTo(mRoot, PR_FALSE);
     NS_ENSURE_SUCCESS(rv, rv);
@@ -1706,18 +1696,16 @@ HTMLContentSink::Init(nsIDocument* aDoc,
 
   // Make head part
   nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::head,
                                            nsnull, kNameSpaceID_XHTML);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
   mHead = NS_NewHTMLHeadElement(nodeInfo);
   if (NS_FAILED(rv)) {
-    MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::Init()\n"));
-    MOZ_TIMER_STOP(mWatch);
     return NS_ERROR_OUT_OF_MEMORY;
   }
   NS_ADDREF(mHead);
 
   mRoot->AppendChildTo(mHead, PR_FALSE);
 
   mCurrentContext = new SinkContext(this);
   NS_ENSURE_TRUE(mCurrentContext, NS_ERROR_OUT_OF_MEMORY);
@@ -1726,20 +1714,16 @@ HTMLContentSink::Init(nsIDocument* aDoc,
 
 #ifdef NS_DEBUG
   nsCAutoString spec;
   (void)aURI->GetSpec(spec);
   SINK_TRACE(gSinkLogModuleInfo, SINK_TRACE_CALLS,
              ("HTMLContentSink::Init: this=%p url='%s'",
               this, spec.get()));
 #endif
-
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::Init()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLContentSink::WillParse(void)
 {
   return WillParseImpl();
 }
@@ -1768,25 +1752,16 @@ HTMLContentSink::WillBuildModel(nsDTDMod
   mDocument->BeginLoad();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLContentSink::DidBuildModel(void)
 {
-  // NRA Dump stopwatch stop info here
-#ifdef MOZ_PERF_METRICS
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::DidBuildModel(), this=%p\n",
-                      this));
-  MOZ_TIMER_STOP(mWatch);
-  MOZ_TIMER_LOG(("Content creation time (this=%p): ", this));
-  MOZ_TIMER_PRINT(mWatch);
-#endif
-
   DidBuildModelImpl();
 
   // Reflow the last batch of content
   if (mBody || mFrameset) {
     SINK_TRACE(gSinkLogModuleInfo, SINK_TRACE_REFLOW,
                ("HTMLContentSink::DidBuildModel: layout final content"));
     mCurrentContext->FlushTags();
   } else if (!mLayoutStarted) {
@@ -1848,26 +1823,21 @@ NS_IMETHODIMP_(PRBool)
 HTMLContentSink::IsFormOnStack()
 {
   return mFormOnStack;
 }
 
 NS_IMETHODIMP
 HTMLContentSink::BeginContext(PRInt32 aPosition)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::BeginContext()\n"));
-  MOZ_TIMER_START(mWatch);
   NS_PRECONDITION(aPosition > -1, "out of bounds");
 
   // Create new context
   SinkContext* sc = new SinkContext(this);
   if (!sc) {
-    MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::BeginContext()\n"));
-    MOZ_TIMER_STOP(mWatch);
-
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   if (!mCurrentContext) {
     NS_ERROR("Non-existing context");
 
     return NS_ERROR_FAILURE;
   }
@@ -1896,28 +1866,22 @@ HTMLContentSink::BeginContext(PRInt32 aP
   sc->Begin(nodeType,
             content,
             mCurrentContext->mStack[aPosition].mNumFlushed,
             insertionPoint);
   NS_ADDREF(sc->mSink);
 
   mContextStack.AppendElement(mCurrentContext);
   mCurrentContext = sc;
-
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::BeginContext()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLContentSink::EndContext(PRInt32 aPosition)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::EndContext()\n"));
-  MOZ_TIMER_START(mWatch);
   NS_PRECONDITION(mCurrentContext && aPosition > -1, "non-existing context");
 
   PRUint32 n = mContextStack.Length() - 1;
   SinkContext* sc = mContextStack.ElementAt(n);
 
   const SinkContext::Node &bottom = mCurrentContext->mStack[0];
   
   NS_ASSERTION(sc->mStack[aPosition].mType == bottom.mType,
@@ -1954,28 +1918,22 @@ HTMLContentSink::EndContext(PRInt32 aPos
   mCurrentContext->mTextSize   = 0;
 
   NS_IF_RELEASE(mCurrentContext->mSink);
 
   delete mCurrentContext;
 
   mCurrentContext = sc;
   mContextStack.RemoveElementAt(n);
-
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::EndContext()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return NS_OK;
 }
 
 nsresult
 HTMLContentSink::CloseHTML()
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::CloseHTML()\n"));
-  MOZ_TIMER_START(mWatch);
   SINK_TRACE_NODE(SINK_TRACE_CALLS,
                  "HTMLContentSink::CloseHTML", 
                  eHTMLTag_html, 0, this);
 
   if (mHeadContext) {
     if (mCurrentContext == mHeadContext) {
       PRUint32 numContexts = mContextStack.Length();
 
@@ -1987,76 +1945,53 @@ HTMLContentSink::CloseHTML()
     NS_ASSERTION(mHeadContext->mTextLength == 0, "Losing text");
 
     mHeadContext->End();
 
     delete mHeadContext;
     mHeadContext = nsnull;
   }
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseHTML()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return NS_OK;
 }
 
 nsresult
 HTMLContentSink::OpenHead()
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::OpenHead()\n"));
-  MOZ_TIMER_START(mWatch);
-
   nsresult rv = OpenHeadContext();
-
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenHead()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return rv;
 }
 
 nsresult
 HTMLContentSink::OpenBody(const nsIParserNode& aNode)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::OpenBody()\n"));
-  MOZ_TIMER_START(mWatch);
-
   SINK_TRACE_NODE(SINK_TRACE_CALLS,
                   "HTMLContentSink::OpenBody", 
                   eHTMLTag_body,
                   mCurrentContext->mStackPos, 
                   this);
 
   CloseHeadContext();  // do this just in case if the HEAD was left open!
 
   // Add attributes, if any, to the current BODY node
   if (mBody) {
     AddAttributes(aNode, mBody, PR_TRUE, PR_TRUE);
-
-    MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenBody()\n"));
-    MOZ_TIMER_STOP(mWatch);
-
     return NS_OK;
   }
 
   nsresult rv = mCurrentContext->OpenContainer(aNode);
 
   if (NS_FAILED(rv)) {
-    MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenBody()\n"));
-    MOZ_TIMER_STOP(mWatch);
-
     return rv;
   }
 
   mBody = mCurrentContext->mStack[mCurrentContext->mStackPos - 1].mContent;
 
   NS_ADDREF(mBody);
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenBody()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   if (mCurrentContext->mStackPos > 1) {
     PRInt32 parentIndex    = mCurrentContext->mStackPos - 2;
     nsGenericHTMLElement *parent = mCurrentContext->mStack[parentIndex].mContent;
     PRInt32 numFlushed     = mCurrentContext->mStack[parentIndex].mNumFlushed;
     PRInt32 childCount = parent->GetChildCount();
     NS_ASSERTION(numFlushed < childCount, "Already notified on the body?");
     
     PRInt32 insertionPoint =
@@ -2083,52 +2018,41 @@ HTMLContentSink::OpenBody(const nsIParse
   StartLayout(PR_FALSE);
 
   return NS_OK;
 }
 
 nsresult
 HTMLContentSink::CloseBody()
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::CloseBody()\n"));
-  MOZ_TIMER_START(mWatch);
   SINK_TRACE_NODE(SINK_TRACE_CALLS,
                   "HTMLContentSink::CloseBody", 
                   eHTMLTag_body,
                   mCurrentContext->mStackPos - 1, 
                   this);
 
   PRBool didFlush;
   nsresult rv = mCurrentContext->FlushTextAndRelease(&didFlush);
   if (NS_FAILED(rv)) {
-    MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseBody()\n"));
-    MOZ_TIMER_STOP(mWatch);
-
     return rv;
   }
 
   // Flush out anything that's left
   SINK_TRACE(gSinkLogModuleInfo, SINK_TRACE_REFLOW,
              ("HTMLContentSink::CloseBody: layout final body content"));
 
   mCurrentContext->FlushTags();
   mCurrentContext->CloseContainer(eHTMLTag_body, PR_FALSE);
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseBody()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return NS_OK;
 }
 
 nsresult
 HTMLContentSink::OpenForm(const nsIParserNode& aNode)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::OpenForm()\n"));
-  MOZ_TIMER_START(mWatch);
-
   nsresult result = NS_OK;
 
   mCurrentContext->FlushTextAndRelease();
 
   SINK_TRACE_NODE(SINK_TRACE_CALLS,
                   "HTMLContentSink::OpenForm", 
                   eHTMLTag_form,
                   mCurrentContext->mStackPos, 
@@ -2149,28 +2073,22 @@ HTMLContentSink::OpenForm(const nsIParse
       mCurrentContext->IsCurrentContainer(eHTMLTag_colgroup)) {
     result = mCurrentContext->AddLeaf(aNode);
   } else {
     mFormOnStack = PR_TRUE;
     // Otherwise the form can be a content parent.
     result = mCurrentContext->OpenContainer(aNode);
   }
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenForm()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return result;
 }
 
 nsresult
 HTMLContentSink::CloseForm()
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::CloseForm()\n"));
-  MOZ_TIMER_START(mWatch);
-
   nsresult result = NS_OK;
 
   SINK_TRACE_NODE(SINK_TRACE_CALLS,
                   "HTMLContentSink::CloseForm",
                   eHTMLTag_form,
                   mCurrentContext->mStackPos - 1, 
                   this);
 
@@ -2179,43 +2097,35 @@ HTMLContentSink::CloseForm()
     if (mCurrentContext->IsCurrentContainer(eHTMLTag_form)) {
       result = mCurrentContext->CloseContainer(eHTMLTag_form, PR_FALSE);
       mFormOnStack = PR_FALSE;
     }
 
     mCurrentForm = nsnull;
   }
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseForm()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return result;
 }
 
 nsresult
 HTMLContentSink::OpenFrameset(const nsIParserNode& aNode)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::OpenFrameset()\n"));
-  MOZ_TIMER_START(mWatch);
   SINK_TRACE_NODE(SINK_TRACE_CALLS,
                   "HTMLContentSink::OpenFrameset", 
                   eHTMLTag_frameset,
                   mCurrentContext->mStackPos, 
                   this);
 
   CloseHeadContext(); // do this just in case if the HEAD was left open!
 
   // Need to keep track of whether OpenContainer changes mFrameset
   nsGenericHTMLElement* oldFrameset = mFrameset;
   nsresult rv = mCurrentContext->OpenContainer(aNode);
   PRBool isFirstFrameset = NS_SUCCEEDED(rv) && mFrameset != oldFrameset;
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenFrameset()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   if (isFirstFrameset && mCurrentContext->mStackPos > 1) {
     NS_ASSERTION(mFrameset, "Must have frameset!");
     // Have to notify for the frameset now, since we never actually
     // close out <html>, so won't notify for it then.
     PRInt32 parentIndex    = mCurrentContext->mStackPos - 2;
     nsGenericHTMLElement *parent = mCurrentContext->mStack[parentIndex].mContent;
     PRInt32 numFlushed     = mCurrentContext->mStack[parentIndex].mNumFlushed;
     PRInt32 childCount = parent->GetChildCount();
@@ -2243,51 +2153,43 @@ HTMLContentSink::OpenFrameset(const nsIP
   }
   
   return rv;
 }
 
 nsresult
 HTMLContentSink::CloseFrameset()
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::CloseFrameset()\n"));
-  MOZ_TIMER_START(mWatch);
   SINK_TRACE_NODE(SINK_TRACE_CALLS,
                    "HTMLContentSink::CloseFrameset", 
                    eHTMLTag_frameset,
                    mCurrentContext->mStackPos - 1,
                    this);
 
   SinkContext* sc = mCurrentContext;
   nsGenericHTMLElement* fs = sc->mStack[sc->mStackPos - 1].mContent;
   PRBool done = fs == mFrameset;
 
   nsresult rv;
   if (done) {
     PRBool didFlush;
     rv = sc->FlushTextAndRelease(&didFlush);
     if (NS_FAILED(rv)) {
-      MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseFrameset()\n"));
-      MOZ_TIMER_STOP(mWatch);
-
       return rv;
     }
 
     // Flush out anything that's left
     SINK_TRACE(gSinkLogModuleInfo, SINK_TRACE_REFLOW,
                ("HTMLContentSink::CloseFrameset: layout final content"));
 
     sc->FlushTags();
   }
 
   rv = sc->CloseContainer(eHTMLTag_frameset, PR_FALSE);    
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseFrameset()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   if (done && mFramesEnabled) {
     StartLayout(PR_FALSE);
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
@@ -2304,19 +2206,16 @@ HTMLContentSink::IsEnabled(PRInt32 aTag,
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLContentSink::OpenContainer(const nsIParserNode& aNode)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::OpenContainer()\n"));
-  MOZ_TIMER_START(mWatch);
-
   nsresult rv = NS_OK;
 
   switch (aNode.GetNodeType()) {
     case eHTMLTag_frameset:
       rv = OpenFrameset(aNode);
       break;
     case eHTMLTag_head:
       rv = OpenHeadContext();
@@ -2342,28 +2241,22 @@ HTMLContentSink::OpenContainer(const nsI
     case eHTMLTag_form:
       rv = OpenForm(aNode);
       break;
     default:
       rv = mCurrentContext->OpenContainer(aNode);
       break;
   }
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenContainer()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return rv;
 }
 
 NS_IMETHODIMP
 HTMLContentSink::CloseContainer(const eHTMLTags aTag)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::CloseContainer()\n"));
-  MOZ_TIMER_START(mWatch);
-
   nsresult rv = NS_OK;
 
   switch (aTag) {
     case eHTMLTag_frameset:
       rv = CloseFrameset();
       break;
     case eHTMLTag_head:
       CloseHeadContext();
@@ -2377,105 +2270,83 @@ HTMLContentSink::CloseContainer(const eH
     case eHTMLTag_form:
       rv = CloseForm();
       break;
     default:
       rv = mCurrentContext->CloseContainer(aTag, PR_FALSE);
       break;
   }
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseContainer()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return rv;
 }
 
 NS_IMETHODIMP
 HTMLContentSink::CloseMalformedContainer(const eHTMLTags aTag)
 {
   return mCurrentContext->CloseContainer(aTag, PR_TRUE);
 }
 
 NS_IMETHODIMP
 HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::AddLeaf()\n"));
-  MOZ_TIMER_START(mWatch);
-
   nsresult rv;
 
   nsHTMLTag nodeType = nsHTMLTag(aNode.GetNodeType());
   switch (nodeType) {
   case eHTMLTag_link:
     mCurrentContext->FlushTextAndRelease();
     rv = ProcessLINKTag(aNode);
 
     break;
   default:
     rv = mCurrentContext->AddLeaf(aNode);
 
     break;
   }
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::AddLeaf()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return rv;
 }
 
 /**
  * This gets called by the parsing system when we find a comment
  * @update	gess11/9/98
  * @param   aNode contains a comment token
  * @return  error code
  */
 nsresult
 HTMLContentSink::AddComment(const nsIParserNode& aNode)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::AddComment()\n"));
-  MOZ_TIMER_START(mWatch);
-
   nsresult rv = mCurrentContext->AddComment(aNode);
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::AddComment()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return rv;
 }
 
 /**
  * This gets called by the parsing system when we find a PI
  * @update	gess11/9/98
  * @param   aNode contains a comment token
  * @return  error code
  */
 nsresult
 HTMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
 {
   nsresult result = NS_OK;
-
-  MOZ_TIMER_START(mWatch);
   // Implementation of AddProcessingInstruction() should start here
 
-  MOZ_TIMER_STOP(mWatch);
-
   return result;
 }
 
 /**
  *  This gets called by the parser when it encounters
  *  a DOCTYPE declaration in the HTML document.
  */
 
 NS_IMETHODIMP
 HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::AddDocTypeDecl()\n"));
-  MOZ_TIMER_START(mWatch);
-
   nsAutoString docTypeStr(aNode.GetText());
   nsresult rv = NS_OK;
 
   PRInt32 publicStart = docTypeStr.Find("PUBLIC", PR_TRUE);
   PRInt32 systemStart = docTypeStr.Find("SYSTEM", PR_TRUE);
   nsAutoString name, publicId, systemId;
 
   if (publicStart >= 0 || systemStart >= 0) {
@@ -2686,19 +2557,16 @@ HTMLContentSink::AddDocTypeDecl(const ns
       // the content sink we assume that this is what we want.
       nsCOMPtr<nsIContent> content = do_QueryInterface(docType);
       NS_ASSERTION(content, "Doctype isn't content?");
       
       mDocument->InsertChildAt(content, 0, PR_TRUE);
     }
   }
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::AddDocTypeDecl()\n"));
-  MOZ_TIMER_STOP(mWatch);
-
   return rv;
 }
 
 NS_IMETHODIMP
 HTMLContentSink::DidProcessTokens(void)
 {
   return NS_OK;
 }
@@ -2974,31 +2842,24 @@ HTMLContentSink::NotifyInsert(nsIContent
   if (aContent && aContent->GetCurrentDoc() != mDocument) {
     // aContent is not actually in our document anymore.... Just bail out of
     // here; notifying on our document for this insert would be wrong.
     return;
   }
 
   mInNotification++;
 
-  MOZ_TIMER_DEBUGLOG(("Save and stop: nsHTMLContentSink::NotifyInsert()\n"));
-  MOZ_TIMER_SAVE(mWatch)
-  MOZ_TIMER_STOP(mWatch);
-
   {
     // Scope so we call EndUpdate before we decrease mInNotification
     MOZ_AUTO_DOC_UPDATE(mDocument, UPDATE_CONTENT_MODEL, !mBeganUpdate);
     nsNodeUtils::ContentInserted(NODE_FROM(aContent, mDocument),
                                  aChildContent, aIndexInContainer);
     mLastNotificationTime = PR_Now();
   }
 
-  MOZ_TIMER_DEBUGLOG(("Restore: nsHTMLContentSink::NotifyInsert()\n"));
-  MOZ_TIMER_RESTORE(mWatch);
-
   mInNotification--;
 }
 
 void
 HTMLContentSink::NotifyRootInsertion()
 {
   NS_PRECONDITION(!mNotifiedRootInsertion, "Double-notifying on root?");
   NS_ASSERTION(!mLayoutStarted,
--- a/content/xml/document/src/nsXMLContentSink.cpp
+++ b/content/xml/document/src/nsXMLContentSink.cpp
@@ -153,36 +153,29 @@ nsXMLContentSink::~nsXMLContentSink()
 }
 
 nsresult
 nsXMLContentSink::Init(nsIDocument* aDoc,
                        nsIURI* aURI,
                        nsISupports* aContainer,
                        nsIChannel* aChannel)
 {
-  MOZ_TIMER_DEBUGLOG(("Reset and start: nsXMLContentSink::Init(), this=%p\n",
-                      this));
-  MOZ_TIMER_RESET(mWatch);
-  MOZ_TIMER_START(mWatch);
-	
   nsresult rv = nsContentSink::Init(aDoc, aURI, aContainer, aChannel);
   NS_ENSURE_SUCCESS(rv, rv);
 
   aDoc->AddObserver(this);
   mIsDocumentObserver = PR_TRUE;
 
   if (!mDocShell) {
     mPrettyPrintXML = PR_FALSE;
   }
   
   mState = eXMLContentSinkState_InProlog;
   mDocElement = nsnull;
 
-  MOZ_TIMER_DEBUGLOG(("Stop: nsXMLContentSink::Init()\n"));
-  MOZ_TIMER_STOP(mWatch);
   return NS_OK;
 }
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXMLContentSink)
   NS_INTERFACE_MAP_ENTRY(nsIContentSink)
   NS_INTERFACE_MAP_ENTRY(nsIXMLContentSink)
   NS_INTERFACE_MAP_ENTRY(nsIExpatSink)
   NS_INTERFACE_MAP_ENTRY(nsITransformObserver)
--- a/embedding/components/build/Makefile.in
+++ b/embedding/components/build/Makefile.in
@@ -47,21 +47,16 @@ EXPORT_LIBRARY = 1
 ifneq ($(OS_ARCH),WINNT)
 SHORT_LIBNAME	= embedcmp
 endif
 IS_COMPONENT	= 1
 MODULE_NAME	= embedcomponents
 GRE_MODULE	= 1
 LIBXUL_LIBRARY	= 1
 
-ifdef MOZ_PERF_METRICS
-EXTRA_DSO_LIBS	= mozutil_s
-endif
-
-
 CPPSRCS		= nsEmbeddingModule.cpp
 
 SHARED_LIBRARY_LIBS = \
 	../windowwatcher/src/$(LIB_PREFIX)windowwatcher_s.$(LIB_SUFFIX) \
 	../appstartup/src/$(LIB_PREFIX)appstartupnotifier_s.$(LIB_SUFFIX) \
 	../find/src/$(LIB_PREFIX)find_s.$(LIB_SUFFIX) \
 	../webbrowserpersist/src/$(LIB_PREFIX)webbrowserpersist_s.$(LIB_SUFFIX) \
 	../commandhandler/src/$(LIB_PREFIX)commandhandler_s.$(LIB_SUFFIX) \
--- a/gfx/src/Makefile.in
+++ b/gfx/src/Makefile.in
@@ -63,17 +63,16 @@ CPPSRCS = \
         nsTransform2D.cpp \
         nsScriptableRegion.cpp \
         $(NULL)
 
 ifeq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
 endif
 
 EXTRA_DSO_LDOPTS = \
-        $(DEPTH)/modules/libutil/src/$(LIB_PREFIX)mozutil_s.$(LIB_SUFFIX) \
         $(MOZ_UNICHARUTIL_LIBS) \
         $(MOZ_COMPONENT_LIBS) \
         $(MOZ_JS_LIBS) \
         $(NULL)
 
 ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += \
         $(TK_LIBS) \
--- a/gfx/src/thebes/Makefile.in
+++ b/gfx/src/thebes/Makefile.in
@@ -107,17 +107,16 @@ LOCAL_INCLUDES	= \
 		-I$(srcdir)/. \
 		-I$(srcdir)/.. \
 		-I$(srcdir)/../shared \
 		$(NULL)
 
 EXTRA_DSO_LDOPTS += \
 		$(LIBS_DIR) \
 		$(EXTRA_DSO_LIBS) \
-		$(DEPTH)/modules/libutil/src/$(LIB_PREFIX)mozutil_s.$(LIB_SUFFIX) \
 		$(MOZ_COMPONENT_LIBS) \
 		$(MOZ_UNICHARUTIL_LIBS) \
 		$(MOZ_JS_LIBS) \
 		$(TK_LIBS) \
 		$(NULL)
 
 ifdef MOZ_X11
 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS)
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -82,17 +82,16 @@ MOZ_DEBUG_ENABLE_DEFS		= @MOZ_DEBUG_ENAB
 MOZ_DEBUG_DISABLE_DEFS	= @MOZ_DEBUG_DISABLE_DEFS@
 MOZ_DEBUG_FLAGS	= @MOZ_DEBUG_FLAGS@
 MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
 MOZ_DBGRINFO_MODULES	= @MOZ_DBGRINFO_MODULES@
 MOZ_EXTENSIONS  = @MOZ_EXTENSIONS@
 MOZ_IMG_DECODERS= @MOZ_IMG_DECODERS@
 MOZ_IMG_ENCODERS= @MOZ_IMG_ENCODERS@
 MOZ_JSDEBUGGER  = @MOZ_JSDEBUGGER@
-MOZ_PERF_METRICS = @MOZ_PERF_METRICS@
 MOZ_LEAKY	= @MOZ_LEAKY@
 MOZ_MEMORY      = @MOZ_MEMORY@
 MOZ_JPROF       = @MOZ_JPROF@
 MOZ_SHARK       = @MOZ_SHARK@
 MOZ_CALLGRIND   = @MOZ_CALLGRIND@
 MOZ_VTUNE       = @MOZ_VTUNE@
 DEHYDRA_PATH    = @DEHYDRA_PATH@
 
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -4899,17 +4899,16 @@ AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
 AC_SUBST(MOZ_DEBUG_FLAGS)
 AC_SUBST(MOZ_DEBUG_LDFLAGS)
 AC_SUBST(WARNINGS_AS_ERRORS)
 AC_SUBST(MOZ_DBGRINFO_MODULES)
 AC_SUBST(ENABLE_EAZEL_PROFILER)
 AC_SUBST(EAZEL_PROFILER_CFLAGS)
 AC_SUBST(EAZEL_PROFILER_LIBS)
-AC_SUBST(MOZ_PERF_METRICS)
 AC_SUBST(GC_LEAK_DETECTOR)
 AC_SUBST(MOZ_LEAKY)
 AC_SUBST(MOZ_JPROF)
 AC_SUBST(MOZ_SHARK)
 AC_SUBST(MOZ_CALLGRIND)
 AC_SUBST(MOZ_VTUNE)
 AC_SUBST(MOZ_XPCTOOLS)
 AC_SUBST(MOZ_JSLOADER)
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -116,17 +116,16 @@
 #include "nsIDOMNSHTMLTextAreaElement.h"
 #include "nsViewsCID.h"
 #include "nsPresArena.h"
 #include "nsFrameManager.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsILayoutHistoryState.h"
 #include "nsILineIterator.h" // for ScrollContentIntoView
-#include "nsTimer.h"
 #include "nsWeakPtr.h"
 #include "pldhash.h"
 #include "nsIObserverService.h"
 #include "nsIObserver.h"
 #include "nsIDocShell.h"        // for reflow observation
 #include "nsIBaseWindow.h"
 #include "nsLayoutErrors.h"
 #include "nsLayoutUtils.h"
@@ -1192,20 +1191,17 @@ protected:
 
   // On Win32 after interupting a reflow we need to post the resume reflow
   // event off a timer to avoid event starvation because posted messages are
   // processed before other messages when the modal moving/sizing loop is
   // running, see bug 491700 for details.
   nsCOMPtr<nsITimer> mReflowContinueTimer;
   static void sReflowContinueCallback(nsITimer* aTimer, void* aPresShell);
   PRBool PostReflowEventOffTimer();
-
-  MOZ_TIMER_DECLARE(mReflowWatch)  // Used for measuring time spent in reflow
-  MOZ_TIMER_DECLARE(mFrameCreationWatch)  // Used for measuring time spent in frame creation 
-
+  
 #ifdef MOZ_REFLOW_PERF
   ReflowCountMgr * mReflowCountMgr;
 #endif
 
   static PRBool sDisableNonTestMouseEvents;
 
 
   nsCOMPtr<nsIDocumentObserver> mDocumentObserverForNonDynamicContext;
@@ -2583,32 +2579,24 @@ PresShell::InitialReflow(nscoord aWidth,
 
   if (!rootFrame) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   nsIContent *root = mDocument->GetRootContent();
 
   if (root) {
-    MOZ_TIMER_DEBUGLOG(("Reset and start: Frame Creation: PresShell::InitialReflow(), this=%p\n",
-                        (void*)this));
-    MOZ_TIMER_RESET(mFrameCreationWatch);
-    MOZ_TIMER_START(mFrameCreationWatch);
-
     {
       nsAutoCauseReflowNotifier reflowNotifier(this);
       mFrameConstructor->BeginUpdate();
 
       // Have the style sheet processor construct frame for the root
       // content object down
       mFrameConstructor->ContentInserted(nsnull, root, 0, nsnull);
       VERIFY_STYLE_TREE;
-      MOZ_TIMER_DEBUGLOG(("Stop: Frame Creation: PresShell::InitialReflow(), this=%p\n",
-                          (void*)this));
-      MOZ_TIMER_STOP(mFrameCreationWatch);
 
       // Something in mFrameConstructor->ContentInserted may have caused
       // Destroy() to get called, bug 337586.
       NS_ENSURE_STATE(!mHaveShutDown);
 
       mFrameConstructor->EndUpdate();
     }
 
@@ -3264,45 +3252,26 @@ PresShell::RestoreRootScrollPosition()
   }
 
   --mChangeNestCount;
 }
 
 void
 PresShell::BeginLoad(nsIDocument *aDocument)
 {  
-#ifdef MOZ_PERF_METRICS
-  // Reset style resolution stopwatch maintained by style set
-  MOZ_TIMER_DEBUGLOG(("Reset: Style Resolution: PresShell::BeginLoad(), this=%p\n", (void*)this));
-#endif  
   mDocumentLoading = PR_TRUE;
 }
 
 void
 PresShell::EndLoad(nsIDocument *aDocument)
 {
   NS_PRECONDITION(aDocument == mDocument, "Wrong document");
   
   RestoreRootScrollPosition();
   
-#ifdef MOZ_PERF_METRICS
-  // Dump reflow, style resolution and frame construction times here.
-  MOZ_TIMER_DEBUGLOG(("Stop: Reflow: PresShell::EndLoad(), this=%p\n", this));
-  MOZ_TIMER_STOP(mReflowWatch);
-  MOZ_TIMER_LOG(("Reflow time (this=%p): ", this));
-  MOZ_TIMER_PRINT(mReflowWatch);  
-
-  MOZ_TIMER_DEBUGLOG(("Stop: Frame Creation: PresShell::EndLoad(), this=%p\n", this));
-  MOZ_TIMER_STOP(mFrameCreationWatch);
-  MOZ_TIMER_LOG(("Frame construction plus style resolution time (this=%p): ", this));
-  MOZ_TIMER_PRINT(mFrameCreationWatch);
-
-  // Print style resolution stopwatch maintained by style set
-  MOZ_TIMER_DEBUGLOG(("Stop: Style Resolution: PresShell::EndLoad(), this=%p\n", this));
-#endif  
   mDocumentLoading = PR_FALSE;
 }
 
 #ifdef DEBUG
 void
 PresShell::VerifyHasDirtyRootAncestor(nsIFrame* aFrame)
 {
   // XXXbz due to bug 372769, can't actually assert anything here...
@@ -4916,29 +4885,24 @@ PresShell::ContentAppended(nsIDocument *
   NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
   NS_PRECONDITION(aContainer, "must have container");
   
   if (!mDidInitialReflow) {
     return;
   }
   
   nsAutoCauseReflowNotifier crNotifier(this);
-  MOZ_TIMER_DEBUGLOG(("Start: Frame Creation: PresShell::ContentAppended(), this=%p\n", this));
-  MOZ_TIMER_START(mFrameCreationWatch);
 
   // Call this here so it only happens for real content mutations and
   // not cases when the frame constructor calls its own methods to force
   // frame reconstruction.
   mFrameConstructor->RestyleForAppend(aContainer, aNewIndexInContainer);
 
   mFrameConstructor->ContentAppended(aContainer, aNewIndexInContainer);
   VERIFY_STYLE_TREE;
-
-  MOZ_TIMER_DEBUGLOG(("Stop: Frame Creation: PresShell::ContentAppended(), this=%p\n", this));
-  MOZ_TIMER_STOP(mFrameCreationWatch);
 }
 
 void
 PresShell::ContentInserted(nsIDocument* aDocument,
                            nsIContent*  aContainer,
                            nsIContent*  aChild,
                            PRInt32      aIndexInContainer)
 {
@@ -7205,19 +7169,16 @@ PresShell::DoVerifyReflow()
     }
   }
 }
 #endif
 
 PRBool
 PresShell::ProcessReflowCommands(PRBool aInterruptible)
 {
-  MOZ_TIMER_DEBUGLOG(("Start: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));
-  MOZ_TIMER_START(mReflowWatch);  
-
   PRBool interrupted = PR_FALSE;
   if (0 != mDirtyRoots.Length()) {
 
 #ifdef DEBUG
     if (VERIFY_REFLOW_DUMP_COMMANDS & gVerifyReflowFlags) {
       printf("ProcessReflowCommands: begin incremental reflow\n");
     }
 #endif
@@ -7275,19 +7236,16 @@ PresShell::ProcessReflowCommands(PRBool 
       // another reflow event to process them.  Note that we want to do this
       // after DidDoReflow(), since that method can change whether there are
       // dirty roots around by flushing, and there's no point in posting a
       // reflow event just to have the flush revoke it.
       if (mDirtyRoots.Length())
         PostReflowEvent();
     }
   }
-  
-  MOZ_TIMER_DEBUGLOG(("Stop: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));
-  MOZ_TIMER_STOP(mReflowWatch);  
 
   if (!mIsDestroying && mShouldUnsuppressPainting &&
       mDirtyRoots.Length() == 0) {
     // We only unlock if we're out of reflows.  It's pointless
     // to unlock if reflows are still pending, since reflows
     // are just going to thrash the frames around some more.  By
     // waiting we avoid an overeager "jitter" effect.
     mShouldUnsuppressPainting = PR_FALSE;
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -196,20 +196,16 @@ ifdef MOZ_PLAINTEXT_EDITOR_ONLY
 DEFINES += -DMOZILLA_PLAINTEXT_EDITOR_ONLY
 else
 SHARED_LIBRARY_LIBS += \
 	$(DEPTH)/editor/libeditor/html/$(LIB_PREFIX)htmleditor_s.$(LIB_SUFFIX) \
 	$(DEPTH)/editor/txtsvc/src/$(LIB_PREFIX)txtsvc_s.$(LIB_SUFFIX) \
 	$(NULL)
 endif
 
-ifdef MOZ_PERF_METRICS
-SHARED_LIBRARY_LIBS += $(DEPTH)/modules/libutil/src/$(LIB_PREFIX)mozutil_s.$(LIB_SUFFIX)
-endif
-
 ifdef ENABLE_EDITOR_API_LOG
 DEFINES += -DENABLE_EDITOR_API_LOG
 endif
 
 EXTRA_DSO_LDOPTS = \
 		$(LIBS_DIR) \
 		$(EXTRA_DSO_LIBS) \
 		$(MOZ_UNICHARUTIL_LIBS) \
deleted file mode 100644
--- a/modules/libutil/Makefile.in
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= util
-
-DIRS		= public src
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/modules/libutil/public/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= util
-XPIDL_MODULE	= util
-
-EXPORTS		= $(srcdir)/stopwatch.h \
-			  $(srcdir)/nsTimer.h
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/modules/libutil/public/nsTimer.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef __NSTIMER_H
-#define __NSTIMER_H
-
-#ifdef MOZ_PERF_METRICS
-
-#include "stopwatch.h"
-
-class nsStackBasedTimer 
-{
-public:
-  nsStackBasedTimer(Stopwatch* aStopwatch) { sw = aStopwatch; }
-  ~nsStackBasedTimer() { if (sw) sw->Stop(); }
-
-  void Start(PRBool aReset) { if (sw) sw->Start(aReset); }
-  void Stop(void) { if (sw) sw->Stop(); }
-  void Reset(void) { if (sw) sw->Reset(); }
-  void SaveState(void) { if (sw) sw->SaveState(); }
-  void RestoreState(void) { if (sw) sw->RestoreState(); }
-  void Print(void) { if (sw) sw->Print(); }
-  
-private:
-  Stopwatch* sw;
-};
-
-// This should be set from preferences at runtime.  For now, make it a compile time flag.
-#define ENABLE_DEBUG_OUTPUT PR_FALSE
-
-// Uncomment and re-build to use the Mac Instrumentation SDK on a Mac.
-// #define MOZ_TIMER_USE_MAC_ISDK
-
-// Uncomment and re-build to use Quantify on Windows
-// #define MOZ_TIMER_USE_QUANTIFY
-
-// Timer macros for the Mac
-#ifdef XP_MAC
-
-#ifdef MOZ_TIMER_USE_MAC_ISDK
-
-#include "InstrumentationHelpers.h"
-#  define MOZ_TIMER_DECLARE(name)  
-#  define MOZ_TIMER_CREATE(name)   \
-  static InstTraceClassRef name = 0;  StInstrumentationLog __traceLog("Creating name..."), name)
-
-#  define MOZ_TIMER_RESET(name, msg)
-#  define MOZ_TIMER_START(name, msg)
-#  define MOZ_TIMER_STOP(name, msg)
-#  define MOZ_TIMER_SAVE(name, msg)
-#  define MOZ_TIMER_RESTORE(name, msg)
-#  define MOZ_TIMER_LOG(msg) \
-  do { __traceLog.LogMiddleEvent(); } while(0)
-
-#  define MOZ_TIMER_DEBUGLOG(msg) \
-  if (ENABLE_DEBUG_OUTPUT) printf msg
-
-#  define MOZ_TIMER_MACISDK_LOGDATA(msg, data) \
-  do { traceLog.LogMiddleEventWithData((msg), (data)); } while (0)
-
-#else
-
-#define MOZ_TIMER_USE_STOPWATCH
-
-#endif  // MOZ_TIMER_USE_MAC_ISDK
-
-#endif  // XP_MAC
-
-
-// Timer macros for Windows
-#ifdef XP_WIN
-
-#ifdef MOZ_TIMER_USE_QUANTIFY
-
-#include "pure.h"
-#include "prprf.h"
-
-#  define MOZ_TIMER_DECLARE(name)
-#  define MOZ_TIMER_CREATE(name)
-#  define MOZ_TIMER_RESET(name)  \
-  QuantifyClearData()
-
-#  define MOZ_TIMER_START(name)  \
-  QuantifyStartRecordingData()
-  
-#  define MOZ_TIMER_STOP(name) \
-  QuantifyStopRecordingData()
-
-#  define MOZ_TIMER_SAVE(name)
-#  define MOZ_TIMER_RESTORE(name)
-
-#  define MOZ_TIMER_PRINT(name)
- 
-#  define MOZ_TIMER_LOG(msg)    \
-do {                            \
-  char* str = PR_smprintf msg;  \
-  QuantifyAddAnnotation(str);   \
-  PR_smprintf_free(str);        \
-} while (0)
-
-#  define MOZ_TIMER_DEBUGLOG(msg) \
-  if (ENABLE_DEBUG_OUTPUT) printf msg
-
-#  define MOZ_TIMER_MACISDK_LOGDATA(msg, data)
-
-#else
-
-#define MOZ_TIMER_USE_STOPWATCH
-
-#endif  // MOZ_TIMER_USE_QUANTIFY
-
-#endif  // XP_WIN
-
-// Timer macros for Unix
-#ifdef XP_UNIX
-
-#define MOZ_TIMER_USE_STOPWATCH
-
-#endif  // XP_UNIX
-
-#ifdef MOZ_TIMER_USE_STOPWATCH
-
-#  define MOZ_TIMER_DECLARE(name)  \
-  Stopwatch name;
-
-#  define MOZ_TIMER_CREATE(name)    \
-  static Stopwatch __sw_name;  nsStackBasedTimer name(&__sw_name)
-
-#  define MOZ_TIMER_RESET(name)  \
-  name.Reset();
-
-#  define MOZ_TIMER_START(name)  \
-  name.Start(PR_FALSE);
-
-#  define MOZ_TIMER_STOP(name) \
-  name.Stop();
-
-#  define MOZ_TIMER_SAVE(name) \
-  name.SaveState();
-
-#  define MOZ_TIMER_RESTORE(name)  \
-  name.RestoreState();
-
-#  define MOZ_TIMER_PRINT(name)   \
-  name.Print();
-
-#  define MOZ_TIMER_LOG(msg)  \
-  printf msg
-
-#  define MOZ_TIMER_DEBUGLOG(msg) \
-  if (ENABLE_DEBUG_OUTPUT) printf msg
-
-#  define MOZ_TIMER_MACISDK_LOGDATA(msg, data)
-
-#endif // MOZ_TIMER_USE_STOPWATCH
-
-#else
-#  define MOZ_TIMER_DECLARE(name)
-#  define MOZ_TIMER_CREATE(name)
-#  define MOZ_TIMER_RESET(name)
-#  define MOZ_TIMER_START(name)
-#  define MOZ_TIMER_STOP(name)
-#  define MOZ_TIMER_SAVE(name)
-#  define MOZ_TIMER_RESTORE(name)
-#  define MOZ_TIMER_PRINT(name)
-#  define MOZ_TIMER_LOG(msg)
-#  define MOZ_TIMER_DEBUGLOG(msg)
-#  define MOZ_TIMER_MACISDK_LOGDATA(msg, data)
-#endif  // MOZ_PERF_METRICS
-
-#endif  // __NSTIMER_H
-
deleted file mode 100644
--- a/modules/libutil/public/stopwatch.h
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef __STOPWATCH_H
-#define __STOPWATCH_H
-#include "nscore.h"
-#include "prlog.h"
-#include "nsDeque.h"
-
-#ifdef XP_MAC
-#define R__MAC
-#endif
-
-#ifdef XP_UNIX
-#define R__UNIX
-#endif
-
-#ifdef MOZ_PERF_METRICS
-#  define NS_RESET_AND_START_STOPWATCH(_sw)          \
-    _sw.Start(PR_TRUE);
-
-#  define NS_START_STOPWATCH(_sw)                    \
-    _sw.Start(PR_FALSE);
-
-#  define NS_STOP_STOPWATCH(_sw)                     \
-    _sw.Stop();
-
-#  define NS_SAVE_STOPWATCH_STATE(_sw)               \
-    _sw.SaveState();
-
-#  define NS_RESTORE_STOPWATCH_STATE(_sw)            \
-    _sw.RestoreState();
-
-#else
-#  define NS_RESET_AND_START_STOPWATCH(_sw) 
-#  define NS_START_STOPWATCH(_sw)
-#  define NS_STOP_STOPWATCH(_sw)
-#  define NS_SAVE_STOPWATCH_STATE(_sw)
-#  define NS_RESTORE_STOPWATCH_STATE(_sw)
-#endif
-
-
-#ifdef MOZ_PERF_METRICS
-
-static PRLogModuleInfo* gLogStopwatchModule = PR_NewLogModule("timing");
-
-#if 0
-#define RAPTOR_TRACE_STOPWATCHES        0x1
-
-#define RAPTOR_STOPWATCH_TRACE(_args)                               \
-  PR_BEGIN_MACRO                                                    \
-  PR_LOG(gLogStopwatchModule, RAPTOR_TRACE_STOPWATCHES, _args);     \
-  PR_END_MACRO
-#endif
-
-#define RAPTOR_STOPWATCH_TRACE(_args)      \
-  PR_BEGIN_MACRO                           \
-  printf _args ;                           \
-  PR_END_MACRO
-
-#else
-#define RAPTOR_TRACE_STOPWATCHES 
-#define RAPTOR_STOPWATCH_TRACE(_args) 
-#endif
-
-#ifdef DEBUG_STOPWATCH
-#define RAPTOR_STOPWATCH_DEBUGTRACE(_args)      \
-  PR_BEGIN_MACRO                                \
-  printf _args ;                                \
-  PR_END_MACRO
-#else
-#define RAPTOR_STOPWATCH_DEBUGTRACE(_args) 
-#endif
-
-class Stopwatch {
-
-private:
-   enum EState { kUndefined, kStopped, kRunning };
-
-   double         fStartRealTime;   //wall clock start time
-   double         fStopRealTime;    //wall clock stop time
-   double         fStartCpuTime;    //cpu start time
-   double         fStopCpuTime;     //cpu stop time
-   double         fTotalCpuTime;    //total cpu time
-   double         fTotalRealTime;   //total real time
-   EState         fState;           //stopwatch state
-   nsDeque*       mSavedStates;     //stack of saved states
-   PRBool         mCreatedStack;    //Initially false.  Set to true in first SaveState() call.
-
-public:
-   Stopwatch();
-   virtual ~Stopwatch();
-
-   void           Start(PRBool reset = PR_TRUE);
-   void           Stop();
-   void           Continue();
-   void           SaveState();      // record current state of stopwatch
-   void           RestoreState();   // restore last recored state of stopwatch
-   double         RealTime();
-   double         RealTimeInMilliseconds();
-   void           Reset() { ResetCpuTime(); ResetRealTime(); }
-   void           ResetCpuTime(double aTime = 0) { Stop();  fTotalCpuTime = aTime; }
-   void           ResetRealTime(double aTime = 0) { Stop(); fTotalRealTime = aTime; }
-   double         CpuTime();
-   void           Print(void);
-   static double  GetRealTime();
-   static double  GetCPUTime();
-
-};
-#endif
deleted file mode 100644
--- a/modules/libutil/src/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= util
-LIBRARY_NAME	= mozutil_s
-
-CPPSRCS		= stopwatch.cpp
-
-FORCE_STATIC_LIB = 1
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/modules/libutil/src/stopwatch.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-#include "stopwatch.h"
-#include <stdio.h>
-#include <time.h>
-#ifdef XP_UNIX
-#include <unistd.h>
-#include <sys/times.h>
-#endif
-#ifdef XP_WIN
-#include "windows.h"
-#endif
-#include "nsDebug.h"
-
-// #define MILLISECOND_RESOLUTION to track time with greater precision
-//  If not defined the resolution is to the second only
-//
-#define MILLISECOND_RESOLUTION
-#ifdef MILLISECOND_RESOLUTION
-double gTicks = 1.0e-4; // for millisecond resolution
-#else
-double gTicks = 1.0e-7; // for second resolution
-#endif
-
-Stopwatch::Stopwatch() {
-
-#ifdef R__UNIX
-   if (!gTicks) gTicks = (clock_t)sysconf(_SC_CLK_TCK);
-#endif
-   fState         = kUndefined;   
-   fTotalCpuTime  = 0;
-   fTotalRealTime = 0;   
-   mCreatedStack = PR_FALSE;
-   mSavedStates = nsnull;
-   Start();
-}
-
-Stopwatch::~Stopwatch() {
-  EState* state = 0;
-  if (mSavedStates) {
-    while ((state = (EState*) mSavedStates->Pop())) {
-      delete state;
-    } 
-    delete mSavedStates;
-  }
-}
-
-void Stopwatch::Start(PRBool reset) {
-   if (reset) {
-      fTotalCpuTime  = 0;
-      fTotalRealTime = 0;
-   }
-   if (fState != kRunning) {
-#ifndef R__UNIX
-      fStartRealTime = GetRealTime();
-      fStartCpuTime  = GetCPUTime();
-#else
-      struct tms cpt;
-      fStartRealTime = (double)times(&cpt) / gTicks;
-      fStartCpuTime  = (double)(cpt.tms_utime+cpt.tms_stime) / gTicks;
-#endif
-   }
-   fState = kRunning;
-}
-
-void Stopwatch::Stop() {
-
-#ifndef R__UNIX
-   fStopRealTime = GetRealTime();
-   fStopCpuTime  = GetCPUTime();
-#else
-   struct tms cpt;
-   fStopRealTime = (double)times(&cpt) / gTicks;
-   fStopCpuTime  = (double)(cpt.tms_utime+cpt.tms_stime) / gTicks;
-#endif
-   if (fState == kRunning) {
-      fTotalCpuTime  += fStopCpuTime  - fStartCpuTime;
-      fTotalRealTime += fStopRealTime - fStartRealTime;
-   }
-   fState = kStopped;
-}
-
-
-void Stopwatch::SaveState() {
-  if (!mCreatedStack) {
-    mSavedStates = new nsDeque(nsnull);
-    if (!mSavedStates)
-      return;
-    mCreatedStack = PR_TRUE;
-  }
-  EState* state = new EState();
-  if (state) {
-    *state = fState;
-    mSavedStates->PushFront((void*) state);
-  }
-}
-
-void Stopwatch::RestoreState() {
-  EState* state = nsnull;
-  state = (EState*) mSavedStates->Pop();
-  if (state) {
-    if (*state == kRunning && fState == kStopped)
-      Start(PR_FALSE);
-    else if (*state == kStopped && fState == kRunning)
-      Stop();
-    delete state;
-  }
-  else {
-    NS_WARNING("Stopwatch::RestoreState(): The saved state stack is empty.\n");
-  }
-}
-
-void Stopwatch::Continue() {
-
-  if (fState != kUndefined) {
-
-    if (fState == kStopped) {
-      fTotalCpuTime  -= fStopCpuTime  - fStartCpuTime;
-      fTotalRealTime -= fStopRealTime - fStartRealTime;
-    }
-
-    fState = kRunning;
-  }
-}
-
-
-// NOTE: returns seconds regardless of the state of the MILLISECOND_RESOLUTION #define
-//
-double Stopwatch::RealTime() {
-
-  if (fState != kUndefined) {
-    if (fState == kRunning)
-      Stop();
-  }
-
-#ifdef MILLISECOND_RESOLUTION
-  return fTotalRealTime/1000;
-#else
-  return fTotalRealTime;
-#endif
-}
-
-// NOTE: returns milliseconds regardless of the state of the MILLISECOND_RESOLUTION #define
-//
-double Stopwatch::RealTimeInMilliseconds() {
-
-  if (fState != kUndefined) {
-    if (fState == kRunning)
-      Stop();
-  }
-
-#ifdef MILLISECOND_RESOLUTION
-  return fTotalRealTime;
-#else
-  return fTotalRealTime * 1000; // we don;t have milliseconds, so fake it
-#endif
-}
-
-// NOTE: returns seconds regardless of the state of the MILLISECOND_RESOLUTION define
-//
-double Stopwatch::CpuTime() {
-  if (fState != kUndefined) {
-
-    if (fState == kRunning)
-      Stop();
-
-  }
-#ifdef MILLISECOND_RESOLUTION
-  return fTotalCpuTime / 1000;  // adjust from milliseconds to seconds
-#else
-  return fTotalCpuTime;
-#endif
-}
-
-
-double Stopwatch::GetRealTime(){ 
-#if defined(R__MAC)
-// return(double)clock() / gTicks;
-   return(double)clock() / 1000000L;
-#elif defined(R__UNIX)
-   struct tms cpt;
-   return (double)times(&cpt) / gTicks;
-#elif defined(R__VMS)
-  return(double)clock()/gTicks;
-#elif defined(WIN32)
-  union     {FILETIME ftFileTime;
-             __int64  ftInt64;
-            } ftRealTime; // time the process has spent in kernel mode
-  SYSTEMTIME st;
-  GetSystemTime(&st);
-  SystemTimeToFileTime(&st,&ftRealTime.ftFileTime);
-  return (double)ftRealTime.ftInt64 * gTicks;
-#endif
-}
-
-double Stopwatch::GetCPUTime() {
-#if defined(R__MAC)
-//  return(double)clock() / gTicks;
-  return(double)clock();
-#elif defined(R__UNIX)
-  struct tms cpt;
-  times(&cpt);
-  return (double)(cpt.tms_utime+cpt.tms_stime) / gTicks;
-#elif defined(R__VMS)
-  return(double)clock()/gTicks;
-#elif defined(WINCE)
-  return 0;
-#elif defined(WIN32)
-
-  FILETIME    ftCreate,       // when the process was created
-              ftExit;         // when the process exited
-
-  union     {FILETIME ftFileTime;
-             __int64  ftInt64;
-            } ftKernel; // time the process has spent in kernel mode
-
-  union     {FILETIME ftFileTime;
-             __int64  ftInt64;
-            } ftUser;   // time the process has spent in user mode
-
-  HANDLE hProcess = GetCurrentProcess();
-#ifdef DEBUG
-  BOOL ret =
-#endif
-    GetProcessTimes(hProcess, &ftCreate, &ftExit,
-                              &ftKernel.ftFileTime, &ftUser.ftFileTime);
-#ifdef DEBUG
-  if (!ret)
-    // ToDo: May want to use NS_ERROR().
-    printf("Error: GetProcessTimes() failed, 0x%lx\n", (int)GetLastError());
-#endif
-
-  /*
-   * Process times are returned in a 64-bit structure, as the number of
-   * 100 nanosecond ticks since 1 January 1601.  User mode and kernel mode
-   * times for this process are in separate 64-bit structures.
-   * To convert to floating point seconds, we will:
-   *
-   *          Convert sum of high 32-bit quantities to 64-bit int
-   */
-  return (double) (ftKernel.ftInt64 + ftUser.ftInt64) * gTicks;
-
-#endif # elif, WIN32
-}
-
-
-void Stopwatch::Print(void) {
-   // Print the real and cpu time passed between the start and stop events.
-
-   double  realt = RealTimeInMilliseconds();
-
-   int  hours = int(realt / 3600000);
-   realt -= hours * 3600000;
-   int  min   = int(realt / 60000);
-   realt -= min * 60000;
-   int  sec   = int(realt/1000);
-   realt -= sec * 1000;
-#ifdef MOZ_PERF_METRICS
-  int ms = int(realt);
-   RAPTOR_STOPWATCH_TRACE(("Real time %d:%d:%d.%d, CP time %.3f\n", hours, min, sec, ms, CpuTime()));
-#elif defined(DEBUG)
-  int ms = int(realt);
-   printf("Real time %d:%d:%d.%d, CP time %.3f\n", hours, min, sec, ms, CpuTime());
-#endif
-}
--- a/parser/html/nsHtml5Parser.h
+++ b/parser/html/nsHtml5Parser.h
@@ -35,17 +35,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef NS_HTML5_PARSER__
 #define NS_HTML5_PARSER__
 
 #include "nsAutoPtr.h"
-#include "nsTimer.h"
 #include "nsIParser.h"
 #include "nsDeque.h"
 #include "nsIURL.h"
 #include "nsParserCIID.h"
 #include "nsITokenizer.h"
 #include "nsThreadUtils.h"
 #include "nsIContentSink.h"
 #include "nsIParserFilter.h"
--- a/parser/htmlparser/src/Makefile.in
+++ b/parser/htmlparser/src/Makefile.in
@@ -51,20 +51,16 @@ GRE_MODULE	= 1
 LIBXUL_LIBRARY = 1
 
 
 SHARED_LIBRARY_LIBS = \
 		$(DEPTH)/parser/expat/lib/$(LIB_PREFIX)mozexpat_s.$(LIB_SUFFIX) \
 		$(DEPTH)/parser/xml/src/$(LIB_PREFIX)saxp.$(LIB_SUFFIX) \
 		$(NULL)
 
-ifdef MOZ_PERF_METRICS
-SHARED_LIBRARY_LIBS +=	$(DEPTH)/modules/libutil/src/$(LIB_PREFIX)mozutil_s.$(LIB_SUFFIX)
-endif
-
 CPPSRCS = \
 		nsScannerString.cpp \
 		nsDTDUtils.cpp      \
 		nsHTMLTokenizer.cpp \
 		nsElementTable.cpp  \
 		nsExpatDriver.cpp   \
 		CNavDTD.cpp         \
 		nsHTMLEntities.cpp  \
--- a/parser/htmlparser/src/nsParser.cpp
+++ b/parser/htmlparser/src/nsParser.cpp
@@ -838,21 +838,16 @@ nsParser::Initialize(PRBool aConstructor
   mCharsetSource = kCharsetUninitialized;
   mCharset.AssignLiteral("ISO-8859-1");
   mInternalState = NS_OK;
   mStreamStatus = 0;
   mCommand = eViewNormal;
   mFlags = NS_PARSER_FLAG_OBSERVERS_ENABLED |
            NS_PARSER_FLAG_PARSER_ENABLED |
            NS_PARSER_FLAG_CAN_TOKENIZE;
-
-  MOZ_TIMER_DEBUGLOG(("Reset: Parse Time: nsParser::nsParser(), this=%p\n", this));
-  MOZ_TIMER_RESET(mParseTime);
-  MOZ_TIMER_RESET(mDTDTime);
-  MOZ_TIMER_RESET(mTokenizeTime);
 }
 
 void
 nsParser::Cleanup()
 {
 #ifdef NS_DEBUG
   if (gDumpContent) {
     if (mSink) {
@@ -1838,33 +1833,29 @@ nsParser::ContinueInterruptedParsing()
 /**
  *  Stops parsing temporarily. That's it will prevent the
  *  parser from building up content model.
  */
 NS_IMETHODIMP_(void)
 nsParser::BlockParser()
 {
   mFlags &= ~NS_PARSER_FLAG_PARSER_ENABLED;
-  MOZ_TIMER_DEBUGLOG(("Stop: Parse Time: nsParser::BlockParser(), this=%p\n", this));
-  MOZ_TIMER_STOP(mParseTime);
 }
 
 /**
  *  Open up the parser for tokenization, building up content
  *  model..etc. However, this method does not resume parsing
  *  automatically. It's the callers' responsibility to restart
  *  the parsing engine.
  */
 NS_IMETHODIMP_(void)
 nsParser::UnblockParser()
 {
   if (!(mFlags & NS_PARSER_FLAG_PARSER_ENABLED)) {
     mFlags |= NS_PARSER_FLAG_PARSER_ENABLED;
-    MOZ_TIMER_DEBUGLOG(("Start: Parse Time: nsParser::UnblockParser(), this=%p\n", this));
-    MOZ_TIMER_START(mParseTime);
   } else {
     NS_WARNING("Trying to unblock an unblocked parser.");
   }
 }
 
 /**
  * Call this to query whether the parser is enabled or not.
  */
@@ -2293,19 +2284,16 @@ nsParser::ParseFragment(const nsAString&
 nsresult
 nsParser::ResumeParse(PRBool allowIteration, PRBool aIsFinalChunk,
                       PRBool aCanInterrupt)
 {
   nsresult result = NS_OK;
 
   if ((mFlags & NS_PARSER_FLAG_PARSER_ENABLED) &&
       mInternalState != NS_ERROR_HTMLPARSER_STOPPARSING) {
-    MOZ_TIMER_DEBUGLOG(("Start: Parse Time: nsParser::ResumeParse(), this=%p\n", this));
-    MOZ_TIMER_START(mParseTime);
-
     NS_ASSERTION(!mSpeculativeScriptThread || !mSpeculativeScriptThread->Parsing(),
                  "Bad races happening, expect to crash!");
 
     result = WillBuildModel(mParserContext->mScanner->GetFilename());
     if (NS_FAILED(result)) {
       mFlags &= ~NS_PARSER_FLAG_CAN_TOKENIZE;
       return result;
     }
@@ -2370,29 +2358,16 @@ nsParser::ResumeParse(PRBool allowIterat
           PRBool theContextIsStringBased =
             CParserContext::eCTString == mParserContext->mContextType;
 
           if (mParserContext->mStreamListenerState == eOnStop ||
               !mParserContext->mMultipart || theContextIsStringBased) {
             if (!mParserContext->mPrevContext) {
               if (mParserContext->mStreamListenerState == eOnStop) {
                 DidBuildModel(mStreamStatus);
-
-                MOZ_TIMER_DEBUGLOG(("Stop: Parse Time: nsParser::ResumeParse(), this=%p\n", this));
-                MOZ_TIMER_STOP(mParseTime);
-
-                MOZ_TIMER_LOG(("Parse Time (this=%p): ", this));
-                MOZ_TIMER_PRINT(mParseTime);
-
-                MOZ_TIMER_LOG(("DTD Time: "));
-                MOZ_TIMER_PRINT(mDTDTime);
-
-                MOZ_TIMER_LOG(("Tokenize Time: "));
-                MOZ_TIMER_PRINT(mTokenizeTime);
-
                 return NS_OK;
               }
             } else {
               CParserContext* theContext = PopContext();
               if (theContext) {
                 theIterationIsOk = allowIteration && theContextIsStringBased;
                 if (theContext->mCopyUnused) {
                   theContext->mScanner->CopyUnusedData(mUnusedInput);
@@ -2415,19 +2390,16 @@ nsParser::ResumeParse(PRBool allowIterat
           mSink->WillInterrupt();
         }
       }
     } else {
       mInternalState = result = NS_ERROR_HTMLPARSER_UNRESOLVEDDTD;
     }
   }
 
-  MOZ_TIMER_DEBUGLOG(("Stop: Parse Time: nsParser::ResumeParse(), this=%p\n", this));
-  MOZ_TIMER_STOP(mParseTime);
-
   return (result == NS_ERROR_HTMLPARSER_INTERRUPTED) ? NS_OK : result;
 }
 
 /**
  *  This is where we loop over the tokens created in the
  *  tokenization phase, and try to make sense out of them.
  */
 nsresult
@@ -2437,25 +2409,23 @@ nsParser::BuildModel()
 
   nsresult result = NS_OK;
   if (mParserContext) {
     result = mParserContext->GetTokenizer(mDTD, mSink, theTokenizer);
   }
 
   if (NS_SUCCEEDED(result)) {
     if (mDTD) {
-      MOZ_TIMER_START(mDTDTime);
       // XXXbenjamn CanInterrupt() and !inDocWrite appear to be covariant.
       PRBool inDocWrite = !!mParserContext->mPrevContext;
       result = mDTD->BuildModel(theTokenizer,
                                 // ignore interruptions in document.write
                                 CanInterrupt() && !inDocWrite,
                                 !inDocWrite, // don't count lines in document.write
                                 &mCharset);
-      MOZ_TIMER_STOP(mDTDTime);
     }
   } else {
     mInternalState = result = NS_ERROR_HTMLPARSER_BADTOKENIZER;
   }
   return result;
 }
 
 /*******************************************************************
@@ -3098,18 +3068,16 @@ nsresult nsParser::Tokenize(PRBool aIsFi
       }
 
       // Reset since the tokens have been flushed.
       mFlags &= ~NS_PARSER_FLAG_FLUSH_TOKENS;
     }
 
     PRBool flushTokens = PR_FALSE;
 
-    MOZ_TIMER_START(mTokenizeTime);
-
     mParserContext->mNumConsumed = 0;
 
     PRBool killSink = PR_FALSE;
 
     WillTokenize(aIsFinalChunk);
     while (NS_SUCCEEDED(result)) {
       mParserContext->mNumConsumed += mParserContext->mScanner->Mark();
       result = theTokenizer->ConsumeToken(*mParserContext->mScanner,
@@ -3130,18 +3098,16 @@ nsresult nsParser::Tokenize(PRBool aIsFi
         // Also remember to update the marked position.
         mFlags |= NS_PARSER_FLAG_FLUSH_TOKENS;
         mParserContext->mNumConsumed += mParserContext->mScanner->Mark();
         break;
       }
     }
     DidTokenize(aIsFinalChunk);
 
-    MOZ_TIMER_STOP(mTokenizeTime);
-
     if (killSink) {
       mSink = nsnull;
     }
   } else {
     result = mInternalState = NS_ERROR_HTMLPARSER_BADTOKENIZER;
   }
 
   return result;
--- a/parser/htmlparser/src/nsParser.h
+++ b/parser/htmlparser/src/nsParser.h
@@ -77,17 +77,16 @@
 #include "nsDeque.h"
 #include "nsParserNode.h"
 #include "nsIURL.h"
 #include "CParserContext.h"
 #include "nsParserCIID.h"
 #include "nsITokenizer.h"
 #include "nsHTMLTags.h"
 #include "nsDTDUtils.h"
-#include "nsTimer.h"
 #include "nsThreadUtils.h"
 #include "nsIContentSink.h"
 #include "nsIParserFilter.h"
 #include "nsCOMArray.h"
 #include "nsIUnicharStreamListener.h"
 #include "nsCycleCollectionParticipant.h"
 
 class nsICharsetConverterManager;
@@ -483,18 +482,12 @@ protected:
     static nsICharsetConverterManager* sCharsetConverterManager;
     static nsIThreadPool*              sSpeculativeThreadPool;
 
     enum {
       kSpeculativeThreadLimit = 15,
       kIdleThreadLimit = 0,
       kIdleThreadTimeout = 50
     };
-
-public:  
-   
-    MOZ_TIMER_DECLARE(mParseTime)
-    MOZ_TIMER_DECLARE(mDTDTime)
-    MOZ_TIMER_DECLARE(mTokenizeTime)
 };
 
 #endif 
 
--- a/parser/htmlparser/src/nsParserModule.cpp
+++ b/parser/htmlparser/src/nsParserModule.cpp
@@ -53,24 +53,24 @@
 #include "nsSAXAttributes.h"
 #include "nsSAXLocator.h"
 #include "nsSAXXMLReader.h"
 
 #ifdef MOZ_VIEW_SOURCE
 #include "nsViewSourceHTML.h"
 #endif
 
-#if defined(NS_DEBUG) || defined(MOZ_PERF_METRICS)
+#if defined(NS_DEBUG)
 #include "nsLoggingSink.h"
 #include "nsExpatDriver.h"
 #endif
 
 //----------------------------------------------------------------------
 
-#if defined(NS_DEBUG) || defined(MOZ_PERF_METRICS)
+#if defined(NS_DEBUG)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsLoggingSink)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsExpatDriver)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser)
 NS_GENERIC_FACTORY_CONSTRUCTOR(CNavDTD)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService)
 
@@ -78,17 +78,17 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserS
 NS_GENERIC_FACTORY_CONSTRUCTOR(CViewSourceHTML)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSAXAttributes)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSAXXMLReader)
 
 static const nsModuleComponentInfo gComponents[] = {
 
-#if defined(NS_DEBUG) || defined(MOZ_PERF_METRICS)
+#if defined(NS_DEBUG)
   { "Logging sink", NS_LOGGING_SINK_CID, NULL, nsLoggingSinkConstructor },
   { "Expat Driver", NS_EXPAT_DRIVER_CID, NULL, nsExpatDriverConstructor },
 #endif
 
   { "Parser", NS_PARSER_CID, NULL, nsParserConstructor },
   { "Navigator HTML DTD", NS_CNAVDTD_CID, NULL, CNavDTDConstructor },
 #ifdef MOZ_VIEW_SOURCE
   { "ViewSource DTD", NS_VIEWSOURCE_DTD_CID, NULL, CViewSourceHTMLConstructor },
--- a/toolkit/library/libxul-config.mk
+++ b/toolkit/library/libxul-config.mk
@@ -176,20 +176,16 @@ endif
 endif
 
 ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
 COMPONENT_LIBS += \
 	windowsproxy \
 	$(NULL)
 endif
 
-ifdef MOZ_PERF_METRICS
-EXTRA_DSO_LIBS  += mozutil_s
-endif
-
 ifdef MOZ_XPINSTALL
 DEFINES += -DMOZ_XPINSTALL
 COMPONENT_LIBS += \
 	xpinstall \
 	$(NULL)
 endif
 
 ifdef MOZ_JSDEBUGGER
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -298,22 +298,16 @@ MAKEFILES_libreg="
 "
 
 MAKEFILES_libpref="
   modules/libpref/Makefile
   modules/libpref/public/Makefile
   modules/libpref/src/Makefile
 "
 
-MAKEFILES_libutil="
-  modules/libutil/Makefile
-  modules/libutil/public/Makefile
-  modules/libutil/src/Makefile
-"
-
 MAKEFILES_libvorbis="
   media/libvorbis/Makefile
   media/libvorbis/lib/Makefile
   media/libvorbis/include/Makefile
   media/libvorbis/include/vorbis/Makefile
 "
 
 MAKEFILES_libtheora="
@@ -859,17 +853,16 @@ add_makefiles "
   $MAKEFILES_xpconnect
   $MAKEFILES_jsdebugger
   $MAKEFILES_content
   $MAKEFILES_layout
   $MAKEFILES_libimg
   $MAKEFILES_libjar
   $MAKEFILES_libreg
   $MAKEFILES_libpref
-  $MAKEFILES_libutil
   $MAKEFILES_plugin
   $MAKEFILES_netwerk
   $MAKEFILES_uriloader
   $MAKEFILES_profile
   $MAKEFILES_rdf
   $MAKEFILES_sun_java
   $MAKEFILES_caps
   $MAKEFILES_chrome
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -83,17 +83,16 @@ tier_gecko_dirs += \
 
 ifdef MOZ_ENABLE_GTK2
 ifdef MOZ_X11
 tier_gecko_dirs     += widget/src/gtkxtbin
 endif
 endif
 
 tier_gecko_dirs	+= \
-		modules/libutil \
 		modules/libjar \
 		db \
 		$(NULL)
 
 ifdef MOZ_PERMISSIONS
 tier_gecko_dirs += \
 		extensions/cookie \
 		extensions/permissions \
--- a/view/src/nsViewManager.cpp
+++ b/view/src/nsViewManager.cpp
@@ -440,24 +440,16 @@ void nsViewManager::Refresh(nsView *aVie
     nsRect damageRect = damageRegion.GetBounds();
     printf("XXX Damage rectangle (%d,%d,%d,%d) does not intersect the widget's view (%d,%d,%d,%d)!\n",
            damageRect.x, damageRect.y, damageRect.width, damageRect.height,
            viewRect.x, viewRect.y, viewRect.width, viewRect.height);
 #endif
     return;
   }
 
-#ifdef NS_VM_PERF_METRICS
-  MOZ_TIMER_DEBUGLOG(("Reset nsViewManager::Refresh(region), this=%p\n", this));
-  MOZ_TIMER_RESET(mWatch);
-
-  MOZ_TIMER_DEBUGLOG(("Start: nsViewManager::Refresh(region)\n"));
-  MOZ_TIMER_START(mWatch);
-#endif
-
   NS_ASSERTION(!IsPainting(), "recursive painting not permitted");
   if (IsPainting()) {
     RootViewManager()->mRecursiveRefreshPending = PR_TRUE;
     return;
   }  
 
   {
     nsAutoScriptBlocker scriptBlocker;
@@ -498,24 +490,16 @@ void nsViewManager::Refresh(nsView *aVie
   }
 
   if (RootViewManager()->mRecursiveRefreshPending) {
     // Unset this flag first, since if aUpdateFlags includes NS_VMREFRESH_IMMEDIATE
     // we'll reenter this code from the UpdateAllViews call.
     RootViewManager()->mRecursiveRefreshPending = PR_FALSE;
     UpdateAllViews(aUpdateFlags);
   }
-
-#ifdef NS_VM_PERF_METRICS
-  MOZ_TIMER_DEBUGLOG(("Stop: nsViewManager::Refresh(region), this=%p\n", this));
-  MOZ_TIMER_STOP(mWatch);
-  MOZ_TIMER_LOG(("vm2 Paint time (this=%p): ", this));
-  MOZ_TIMER_PRINT(mWatch);
-#endif
-
 }
 
 // aRC and aRegion are in view coordinates
 void nsViewManager::RenderViews(nsView *aView, nsIRenderingContext& aRC,
                                 const nsRegion& aRegion)
 {
   nsView* displayRoot = GetDisplayRootFor(aView);
   // Make sure we call Paint from the view manager that owns displayRoot.
--- a/view/src/nsViewManager.h
+++ b/view/src/nsViewManager.h
@@ -46,23 +46,18 @@
 #include "nsVoidArray.h"
 #include "nsThreadUtils.h"
 #include "nsIScrollableView.h"
 #include "nsIRegion.h"
 #include "nsView.h"
 #include "nsIViewObserver.h"
 
 //Uncomment the following line to enable generation of viewmanager performance data.
-#ifdef MOZ_PERF_METRICS
-//#define NS_VM_PERF_METRICS 1 
-#endif
+//#define NS_VM_PERF_METRICS 1
 
-#ifdef NS_VM_PERF_METRICS
-#include "nsTimer.h"
-#endif
 
 /**
    Invalidation model:
 
    1) Callers call into the view manager and ask it to update a view.
    
    2) The view manager finds the "right" widget for the view, henceforth called
       the root widget.
@@ -416,18 +411,14 @@ private:
 
   //Rendering context used to cleanup the blending buffers
   static nsIRenderingContext* gCleanupContext;
 
   //list of view managers
   static nsVoidArray       *gViewManagers;
 
   void PostInvalidateEvent();
-
-#ifdef NS_VM_PERF_METRICS
-  MOZ_TIMER_DECLARE(mWatch) //  Measures compositing+paint time for current document
-#endif
 };
 
 //when the refresh happens, should it be double buffered?
 #define NS_VMREFRESH_DOUBLE_BUFFER      0x0001
 
 #endif /* nsViewManager_h___ */
--- a/xpfe/browser/src/nsBrowserInstance.cpp
+++ b/xpfe/browser/src/nsBrowserInstance.cpp
@@ -92,19 +92,19 @@
 
 #include "nsNetUtil.h"
 
 // Stuff to implement file download dialog.
 #include "nsIProxyObjectManager.h" 
 
 #include "nsXPFEComponentsCID.h"
 
-// If DEBUG, NS_BUILD_REFCNT_LOGGING, MOZ_PERF_METRICS, or MOZ_JPROF is
+// If DEBUG, NS_BUILD_REFCNT_LOGGING, or MOZ_JPROF is
 // defined, enable the PageCycler.
-#if defined(DEBUG) || defined(NS_BUILD_REFCNT_LOGGING) || defined(MOZ_PERF_METRICS) || defined(MOZ_JPROF)
+#if defined(DEBUG) || defined(NS_BUILD_REFCNT_LOGGING) || defined(MOZ_JPROF)
 #define ENABLE_PAGE_CYCLER
 #endif
 
 #ifdef DEBUG                                                           
 static int APP_DEBUG = 0; // Set to 1 in debugger to turn on debugging.
 #else                                                                  
 #define APP_DEBUG 0                                                    
 #endif                                                                 
--- a/xpfe/components/build/Makefile.in
+++ b/xpfe/components/build/Makefile.in
@@ -49,20 +49,16 @@ IS_COMPONENT	= 1
 MODULE_NAME	= application
 LIBXUL_LIBRARY	= 1
 
 
 CPPSRCS		= nsModule.cpp
 
 include $(topsrcdir)/config/config.mk
 
-ifdef MOZ_PERF_METRICS
-SHARED_LIBRARY_LIBS += $(DEPTH)/modules/libutil/src/$(LIB_PREFIX)mozutil_s.$(LIB_SUFFIX)
-endif
-
 # General includes
 SHARED_LIBRARY_LIBS += ../directory/$(LIB_PREFIX)directory_s.$(LIB_SUFFIX)
 LOCAL_INCLUDES += -I$(srcdir)/../directory
 
 # Non-Mac Browser requirements
 ifneq ($(MOZ_BUILD_APP),macbrowser)
 SHARED_LIBRARY_LIBS += ../../browser/src/$(LIB_PREFIX)mozbrwsr_s.$(LIB_SUFFIX)
 LOCAL_INCLUDES += -I$(srcdir)/../../browser/src