Bug 792502 - Kill the FunctionTimer code; r=vlad
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 19 Sep 2012 16:59:38 -0400
changeset 107545 e161d18990dc4abbe263076745686a7aee201f31
parent 107544 7fa37833033153902f7e8c009af41bfa27b12c3a
child 107546 c1cd7da16cd6c9b9e233d6e50c64b036fa572985
push id23490
push userMs2ger@gmail.com
push dateThu, 20 Sep 2012 11:22:06 +0000
treeherdermozilla-central@6a2d1a3556b9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs792502
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 792502 - Kill the FunctionTimer code; r=vlad
accessible/src/base/nsAccessibilityService.cpp
configure.in
content/base/src/nsDocument.cpp
content/base/src/nsScriptLoader.cpp
content/events/src/nsEventDispatcher.cpp
content/xbl/src/nsBindingManager.cpp
content/xbl/src/nsXBLProtoImplField.cpp
content/xbl/src/nsXBLProtoImplMethod.cpp
content/xbl/src/nsXBLService.cpp
content/xul/document/src/nsXULDocument.cpp
content/xul/document/src/nsXULPrototypeDocument.cpp
docshell/base/nsDocShell.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsJSEnvironment.cpp
editor/libeditor/base/nsEditor.cpp
editor/libeditor/text/nsPlaintextEditor.cpp
embedding/components/appstartup/src/nsAppStartupNotifier.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatformFontList.h
image/src/imgLoader.cpp
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/loader/mozJSSubScriptLoader.cpp
js/xpconnect/src/XPCJSRuntime.cpp
layout/base/nsDocumentViewer.cpp
layout/base/nsPresShell.cpp
layout/build/nsContentDLF.cpp
layout/forms/nsTextControlFrame.cpp
layout/style/Loader.cpp
modules/libjar/nsZipArchive.cpp
netwerk/base/src/nsIOService.cpp
netwerk/base/src/nsSocketTransportService2.cpp
netwerk/cache/nsCacheService.cpp
netwerk/cache/nsDiskCacheDevice.cpp
netwerk/cache/nsDiskCacheDeviceSQL.cpp
netwerk/cookie/nsCookieService.cpp
netwerk/dns/nsDNSService2.cpp
netwerk/dns/nsEffectiveTLDService.cpp
netwerk/dns/nsHostResolver.cpp
netwerk/dns/nsIDNService.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
startupcache/StartupCache.cpp
storage/src/mozStorageService.cpp
storage/src/mozStorageStatement.cpp
toolkit/components/places/nsNavBookmarks.cpp
toolkit/components/places/nsNavHistory.cpp
toolkit/components/startup/nsAppStartup.cpp
toolkit/xre/nsAppRunner.cpp
uriloader/base/nsURILoader.cpp
widget/android/GfxInfo.cpp
widget/cocoa/GfxInfo.mm
widget/windows/GfxInfo.cpp
widget/windows/nsWindow.cpp
xpcom/base/FunctionTimer.cpp
xpcom/base/FunctionTimer.h
xpcom/base/Makefile.in
xpcom/base/nsStackWalk.cpp
xpcom/build/nsXPComInit.cpp
xpcom/components/nsCategoryManager.cpp
xpcom/components/nsComponentManager.cpp
xpcom/glue/FileUtils.cpp
xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp
xpcom/threads/nsThread.cpp
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -50,17 +50,16 @@
 #include "nsIDOMDocument.h"
 #include "nsIDOMHTMLObjectElement.h"
 #include "nsIDOMXULElement.h"
 #include "nsImageFrame.h"
 #include "nsIObserverService.h"
 #include "nsLayoutUtils.h"
 #include "nsNPAPIPluginInstance.h"
 #include "nsObjectFrame.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/Util.h"
 
 #ifdef MOZ_XUL
 #include "XULAlertAccessible.h"
 #include "XULColorPickerAccessible.h"
@@ -83,17 +82,16 @@ using namespace mozilla::a11y;
 
 nsAccessibilityService *nsAccessibilityService::gAccessibilityService = nullptr;
 ApplicationAccessible* nsAccessibilityService::gApplicationAccessible = nullptr;
 bool nsAccessibilityService::gIsShutdown = true;
 
 nsAccessibilityService::nsAccessibilityService() :
   nsAccDocManager(), FocusManager()
 {
-  NS_TIME_FUNCTION;
 }
 
 nsAccessibilityService::~nsAccessibilityService()
 {
   NS_ASSERTION(gIsShutdown, "Accessibility wasn't shutdown!");
   gAccessibilityService = nullptr;
 }
 
--- a/configure.in
+++ b/configure.in
@@ -7261,29 +7261,16 @@ fi
 dnl ========================================================
 dnl =
 dnl = Profiling and Instrumenting
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Profiling and Instrumenting)
 
 dnl ========================================================
-dnl = Enable NS_FUNCTION_TIMER, which provides Function
-dnl = timing for identifying code bottlenecks
-dnl = NS_FUNCTION_TIMER is off by default.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(functiontimer,
-[  --enable-functiontimer  Enable NS_FUNCTION_TIMER ],
-    NS_FUNCTION_TIMER=1,
-    NS_FUNCTION_TIMER= )
-if test -n "$NS_FUNCTION_TIMER"; then
-    AC_DEFINE(NS_FUNCTION_TIMER)
-fi
-
-dnl ========================================================
 dnl = Enable runtime visual profiling logger
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(visual-event-tracer,
 [  --enable-visual-event-tracer   Enable visual event tracer instrumentation],
     MOZ_VISUAL_EVENT_TRACER=1,
     MOZ_VISUAL_EVENT_TRACER=)
 if test -n "$MOZ_VISUAL_EVENT_TRACER"; then
     AC_DEFINE(MOZ_VISUAL_EVENT_TRACER)
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -36,17 +36,16 @@
 #include "nsAsyncDOMEvent.h"
 #include "nsIDOMNodeFilter.h"
 
 #include "nsIDOMStyleSheet.h"
 #include "nsDOMAttribute.h"
 #include "nsIDOMDOMStringList.h"
 #include "nsIDOMDOMImplementation.h"
 #include "nsIDOMDocumentXBL.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsGenericElement.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMCDATASection.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsDOMString.h"
 #include "nsNodeUtils.h"
 #include "nsLayoutUtils.h" // for GetFrameForPoint
 #include "nsIFrame.h"
@@ -4233,17 +4232,16 @@ nsDocument::LookupImageElement(const nsA
 
   nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aId);
   return entry ? entry->GetImageIdElement() : nullptr;
 }
 
 void
 nsDocument::DispatchContentLoadedEvents()
 {
-  NS_TIME_FUNCTION;
   // If you add early returns from this method, make sure you're
   // calling UnblockOnload properly.
 
   // Unpin references to preloaded images
   mPreloadingImages.Clear();
 
   if (mTiming) {
     mTiming->NotifyDOMContentLoadedStart(nsIDocument::GetDocumentURI());
--- a/content/base/src/nsScriptLoader.cpp
+++ b/content/base/src/nsScriptLoader.cpp
@@ -39,17 +39,16 @@
 #include "nsIChannelPolicy.h"
 #include "nsChannelPolicy.h"
 #include "nsCRT.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsGenericElement.h"
 #include "nsCrossSiteListenerProxy.h"
 #include "nsSandboxFlags.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/CORSMode.h"
 #include "mozilla/Attributes.h"
 
 #ifdef PR_LOGGING
 static PRLogModuleInfo* gCspPRLog;
 #endif
 
 using namespace mozilla;
@@ -697,18 +696,16 @@ nsScriptLoader::ProcessRequest(nsScriptL
 {
   NS_ASSERTION(nsContentUtils::IsSafeToRunScript(),
                "Processing requests when running scripts is unsafe.");
 
   NS_ENSURE_ARG(aRequest);
   nsAFlatString* script;
   nsAutoString textData;
 
-  NS_TIME_FUNCTION;
-
   nsCOMPtr<nsIDocument> doc;
 
   nsCOMPtr<nsINode> scriptElem = do_QueryInterface(aRequest->mElement);
 
   // If there's no script text, we try to get it from the element
   if (aRequest->mIsInline) {
     // XXX This is inefficient - GetText makes multiple
     // copies.
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -5,17 +5,16 @@
 
 #include "nsEventDispatcher.h"
 #include "nsDOMEvent.h"
 #include "nsIDOMEventTarget.h"
 #include "nsPresContext.h"
 #include "nsEventListenerManager.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsMutationEvent.h"
 #include NEW_H
 #include "nsFixedSizeAllocator.h"
 #include "nsINode.h"
 #include "nsPIDOMWindow.h"
 #include "nsFrameLoader.h"
 #include "nsDOMTouchEvent.h"
 #include "nsDOMStorage.h"
@@ -456,22 +455,16 @@ nsEventDispatcher::Dispatch(nsISupports*
   NS_ASSERTION(!aTargets || !aEvent->message, "Wrong parameters!");
 
   // If we're dispatching an already created DOMEvent object, make
   // sure it is initialized!
   // If aTargets is non-null, the event isn't going to be dispatched.
   NS_ENSURE_TRUE(aEvent->message || !aDOMEvent || aTargets,
                  NS_ERROR_DOM_INVALID_STATE_ERR);
 
-#ifdef NS_FUNCTION_TIMER
-  const char* timer_event_name = nsDOMEvent::GetEventName(aEvent->message);
-  NS_TIME_FUNCTION_MIN_FMT(20, "Dispatching '%s' event",
-                           timer_event_name ? timer_event_name : "<other>");
-#endif
-
   nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aTarget);
 
   bool retargeted = false;
 
   if (aEvent->flags & NS_EVENT_RETARGET_TO_NON_NATIVE_ANONYMOUS) {
     nsCOMPtr<nsIContent> content = do_QueryInterface(target);
     if (content && content->IsInNativeAnonymousSubtree()) {
       nsCOMPtr<nsPIDOMEventTarget> newTarget =
--- a/content/xbl/src/nsBindingManager.cpp
+++ b/content/xbl/src/nsBindingManager.cpp
@@ -11,17 +11,16 @@
 #include "nsIURL.h"
 #include "nsIChannel.h"
 #include "nsXPIDLString.h"
 #include "nsNetUtil.h"
 #include "plstr.h"
 #include "nsIContent.h"
 #include "nsIDOMElement.h"
 #include "nsIDocument.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsContentUtils.h"
 #include "nsIPresShell.h"
 #include "nsIXMLContentSink.h"
 #include "nsContentCID.h"
 #include "nsXMLDocument.h"
 #include "nsIStreamListener.h"
 
 #include "nsXBLBinding.h"
@@ -991,18 +990,16 @@ nsBindingManager::DoProcessAttachedQueue
 }
 
 void
 nsBindingManager::ProcessAttachedQueue(uint32_t aSkipSize)
 {
   if (mProcessingAttachedStack || mAttachedStack.Length() <= aSkipSize)
     return;
 
-  NS_TIME_FUNCTION;
-
   mProcessingAttachedStack = true;
 
   // Excute constructors. Do this from high index to low
   while (mAttachedStack.Length() > aSkipSize) {
     uint32_t lastItem = mAttachedStack.Length() - 1;
     nsRefPtr<nsXBLBinding> binding = mAttachedStack.ElementAt(lastItem);
     mAttachedStack.RemoveElementAt(lastItem);
     if (binding) {
--- a/content/xbl/src/nsXBLProtoImplField.cpp
+++ b/content/xbl/src/nsXBLProtoImplField.cpp
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIAtom.h"
 #include "nsString.h"
 #include "jsapi.h"
 #include "nsUnicharUtils.h"
 #include "nsReadableUtils.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsXBLProtoImplField.h"
 #include "nsIScriptContext.h"
 #include "nsIURI.h"
 #include "nsXBLSerialize.h"
 #include "nsXBLPrototypeBinding.h"
 
 nsXBLProtoImplField::nsXBLProtoImplField(const PRUnichar* aName, const PRUnichar* aReadOnly)
   : mNext(nullptr),
@@ -74,17 +73,16 @@ nsXBLProtoImplField::AppendFieldText(con
 
 nsresult
 nsXBLProtoImplField::InstallField(nsIScriptContext* aContext,
                                   JSObject* aBoundNode,
                                   nsIPrincipal* aPrincipal,
                                   nsIURI* aBindingDocURI,
                                   bool* aDidInstall) const
 {
-  NS_TIME_FUNCTION_MIN(5);
   NS_PRECONDITION(aBoundNode,
                   "uh-oh, bound node should NOT be null or bad things will "
                   "happen");
 
   *aDidInstall = false;
 
   // Empty fields are treated as not actually present.
   if (IsEmpty()) {
--- a/content/xbl/src/nsXBLProtoImplMethod.cpp
+++ b/content/xbl/src/nsXBLProtoImplMethod.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIAtom.h"
 #include "nsString.h"
 #include "jsapi.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIScriptGlobalObject.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsUnicharUtils.h"
 #include "nsReadableUtils.h"
 #include "nsXBLProtoImplMethod.h"
 #include "nsIScriptContext.h"
 #include "nsContentUtils.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIXPConnect.h"
 #include "nsXBLPrototypeBinding.h"
@@ -134,17 +133,16 @@ nsXBLProtoImplMethod::InstallMember(nsIS
   }
   return NS_OK;
 }
 
 nsresult 
 nsXBLProtoImplMethod::CompileMember(nsIScriptContext* aContext, const nsCString& aClassStr,
                                     JSObject* aClassObject)
 {
-  NS_TIME_FUNCTION_MIN(5);
   NS_PRECONDITION(!IsCompiled(),
                   "Trying to compile an already-compiled method");
   NS_PRECONDITION(aClassObject,
                   "Must have class object to compile");
 
   nsXBLUncompiledMethod* uncompiledMethod = GetUncompiledMethod();
 
   // No parameters or body was supplied, so don't install method.
--- a/content/xbl/src/nsXBLService.cpp
+++ b/content/xbl/src/nsXBLService.cpp
@@ -18,17 +18,16 @@
 #include "nsIChannel.h"
 #include "nsXPIDLString.h"
 #include "plstr.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIXMLContentSink.h"
 #include "nsContentCID.h"
 #include "nsXMLDocument.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsGkAtoms.h"
 #include "nsIMemory.h"
 #include "nsIObserverService.h"
 #include "nsIDOMNodeList.h"
 #include "nsXBLContentSink.h"
 #include "nsXBLBinding.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsXBLDocumentInfo.h"
@@ -1062,18 +1061,16 @@ nsXBLService::LoadBindingDocumentInfo(ns
   return NS_OK;
 }
 
 nsresult
 nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoundDocument,
                                    nsIURI* aDocumentURI, nsIURI* aBindingURI, 
                                    bool aForceSyncLoad, nsIDocument** aResult)
 {
-  NS_TIME_FUNCTION;
-
   nsresult rv = NS_OK;
   // Initialize our out pointer to nullptr
   *aResult = nullptr;
 
   // Now we have to synchronously load the binding file.
   // Create an XML content sink and a parser. 
   nsCOMPtr<nsILoadGroup> loadGroup;
   if (aBoundDocument)
--- a/content/xul/document/src/nsXULDocument.cpp
+++ b/content/xul/document/src/nsXULDocument.cpp
@@ -53,17 +53,16 @@
 #include "nsXPIDLString.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIWindowRoot.h"
 #include "nsXULCommandDispatcher.h"
 #include "nsXULElement.h"
 #include "prlog.h"
 #include "rdf.h"
 #include "nsIFrame.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsXBLService.h"
 #include "nsCExternalHandlerService.h"
 #include "nsMimeTypes.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsContentList.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptGlobalObjectOwner.h"
@@ -2811,17 +2810,16 @@ FirePendingMergeNotification(nsIURI* aKe
     observers->Remove(aKey);
 
     return PL_DHASH_REMOVE;
 }
 
 nsresult
 nsXULDocument::ResumeWalk()
 {
-    NS_TIME_FUNCTION;
     // Walk the prototype and build the delegate content model. The
     // walk is performed in a top-down, left-to-right fashion. That
     // is, a parent is built before any of its children; a node is
     // only built after all of its siblings to the left are fully
     // constructed.
     //
     // It is interruptable so that transcluded documents (e.g.,
     // <html:script src="..." />) can be properly re-loaded if the
--- a/content/xul/document/src/nsXULPrototypeDocument.cpp
+++ b/content/xul/document/src/nsXULPrototypeDocument.cpp
@@ -17,17 +17,16 @@
 #include "nsIScriptRuntime.h"
 #include "nsIServiceManager.h"
 #include "nsIArray.h"
 #include "nsIURI.h"
 #include "jsapi.h"
 #include "nsString.h"
 #include "nsIConsoleService.h"
 #include "nsIScriptError.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsIDOMScriptObjectFactory.h"
 #include "nsDOMCID.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentUtils.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsDOMJSUtils.h" // for GetScriptContextFromJSContext
 #include "xpcpublic.h"
 #include "mozilla/dom/BindingUtils.h"
@@ -240,17 +239,16 @@ nsXULPrototypeDocument::NewXULPDGlobalOb
 //----------------------------------------------------------------------
 //
 // nsISerializable methods
 //
 
 NS_IMETHODIMP
 nsXULPrototypeDocument::Read(nsIObjectInputStream* aStream)
 {
-    NS_TIME_FUNCTION;
     nsresult rv;
 
     rv = aStream->ReadObject(true, getter_AddRefs(mURI));
 
     uint32_t count, i;
     nsCOMPtr<nsIURI> styleOverlayURI;
 
     nsresult tmp = aStream->Read32(&count);
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -46,17 +46,16 @@
 #include "nsIPrompt.h"
 #include "nsIAuthPrompt.h"
 #include "nsIAuthPrompt2.h"
 #include "nsTextFormatter.h"
 #include "nsIChannelEventSink.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIUploadChannel.h"
 #include "nsISecurityEventSink.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIJSContextStack.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIScrollableFrame.h"
 #include "nsContentPolicyUtils.h" // NS_CheckContentLoadPolicy(...)
 #include "nsICategoryManager.h"
 #include "nsXPCOMCID.h"
 #include "nsISeekableStream.h"
@@ -6657,18 +6656,16 @@ nsDocShell::EndPageLoad(nsIWebProgress *
 NS_IMETHODIMP
 nsDocShell::EnsureContentViewer()
 {
     if (mContentViewer)
         return NS_OK;
     if (mIsBeingDestroyed)
         return NS_ERROR_FAILURE;
 
-    NS_TIME_FUNCTION;
-
     nsCOMPtr<nsIURI> baseURI;
     nsIPrincipal* principal = GetInheritedPrincipal(false);
     nsCOMPtr<nsIDocShellTreeItem> parentItem;
     GetSameTypeParent(getter_AddRefs(parentItem));
     if (parentItem) {
         nsCOMPtr<nsPIDOMWindow> domWin = do_GetInterface(GetAsSupports(this));
         if (domWin) {
             nsCOMPtr<nsIContent> parentContent =
@@ -11195,18 +11192,16 @@ nsDocShell::EnsureScriptEnvironment()
 {
     if (mScriptGlobal)
         return NS_OK;
 
     if (mIsBeingDestroyed) {
         return NS_ERROR_NOT_AVAILABLE;
     }
 
-    NS_TIME_FUNCTION;
-
 #ifdef DEBUG
     NS_ASSERTION(!mInEnsureScriptEnv,
                  "Infinite loop! Calling EnsureScriptEnvironment() from "
                  "within EnsureScriptEnvironment()!");
 
     // Yeah, this isn't re-entrant safe, but that's ok since if we
     // re-enter this method, we'll infinitely loop...
     AutoRestore<bool> boolSetter(mInEnsureScriptEnv);
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -145,17 +145,16 @@
 #include "nsGlobalWindowCommands.h"
 #include "nsAutoPtr.h"
 #include "nsContentUtils.h"
 #include "nsCSSProps.h"
 #include "nsBlobProtocolHandler.h"
 #include "nsIDOMFile.h"
 #include "nsIDOMFileList.h"
 #include "nsIURIFixup.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsCDefaultURIFixup.h"
 #include "nsEventDispatcher.h"
 #include "nsIObserverService.h"
 #include "nsIXULAppInfo.h"
 #include "nsNetUtil.h"
 #include "nsFocusManager.h"
 #include "nsIXULWindow.h"
 #include "nsEventStateManager.h"
@@ -193,17 +192,16 @@
 #include "nsIPopupWindowManager.h"
 
 #include "nsIDragService.h"
 #include "mozilla/dom/Element.h"
 #include "nsFrameLoader.h"
 #include "nsISupportsPrimitives.h"
 #include "nsXPCOMCID.h"
 #include "GeneratedEvents.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozIThirdPartyUtil.h"
 
 #ifdef MOZ_LOGGING
 // so we can get logging even in release builds
 #define FORCE_PR_LOG 1
 #endif
 #include "prlog.h"
 #include "prenv.h"
@@ -1730,18 +1728,16 @@ CreateNativeGlobalForInner(JSContext* aC
   return NS_OK;
 }
 
 nsresult
 nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
                                nsISupports* aState,
                                bool aForceReuseInnerWindow)
 {
-  NS_TIME_FUNCTION;
-
   NS_PRECONDITION(mDocumentPrincipal == nullptr,
                   "mDocumentPrincipal prematurely set!");
   MOZ_ASSERT(aDocument);
 
   if (IsInnerWindow()) {
     if (!mOuterWindow) {
       return NS_ERROR_NOT_INITIALIZED;
     }
@@ -9599,18 +9595,16 @@ nsGlobalWindow::RunTimeoutHandler(nsTime
     // Evaluate the timeout expression.
     const PRUnichar* script = handler->GetHandlerText();
     NS_ASSERTION(script, "timeout has no script nor handler text!");
 
     const char* filename = nullptr;
     uint32_t lineNo = 0;
     handler->GetLocation(&filename, &lineNo);
 
-    NS_TIME_FUNCTION_MARK("(file: %s, line: %d)", filename, lineNo);
-
     bool is_undefined;
     aScx->EvaluateString(nsDependentString(script), FastGetGlobalJSObject(),
                          timeout->mPrincipal, timeout->mPrincipal,
                          filename, lineNo, JSVERSION_DEFAULT, nullptr,
                          &is_undefined);
   } else {
     nsCOMPtr<nsIVariant> dummy;
     nsCOMPtr<nsISupports> me(static_cast<nsIDOMWindow *>(this));
@@ -9732,18 +9726,16 @@ void
 nsGlobalWindow::RunTimeout(nsTimeout *aTimeout)
 {
   // If a modal dialog is open for this window, return early. Pending
   // timeouts will run when the modal dialog is dismissed.
   if (IsInModalState() || mTimeoutsSuspendDepth) {
     return;
   }
 
-  NS_TIME_FUNCTION;
-
   NS_ASSERTION(IsInnerWindow(), "Timeout running on outer window!");
   NS_ASSERTION(!IsFrozen(), "Timeout running on a window in the bfcache!");
 
   nsTimeout *nextTimeout, *timeout;
   nsTimeout *last_expired_timeout, *last_insertion_point;
   nsTimeout dummy_timeout;
   uint32_t firingDepth = mTimeoutFiringDepth + 1;
 
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -70,17 +70,16 @@
 #endif
 #ifdef MOZ_LOGGING
 // Force PR_LOGGING so we can get JS strict warnings even in release builds
 #define FORCE_PR_LOG 1
 #endif
 #include "prlog.h"
 #include "prthread.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/CanvasRenderingContext2DBinding.h"
 
 #include "sampler.h"
 
@@ -1231,19 +1230,16 @@ nsJSContext::EvaluateStringWithValue(con
                                      JSObject* aScopeObject,
                                      nsIPrincipal *aPrincipal,
                                      const char *aURL,
                                      uint32_t aLineNo,
                                      uint32_t aVersion,
                                      JS::Value* aRetValue,
                                      bool* aIsUndefined)
 {
-  NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (url: %s, line: %d)", MOZ_FUNCTION_NAME,
-                           __LINE__, aURL, aLineNo);
-
   SAMPLE_LABEL("JS", "EvaluateStringWithValue");
   NS_ABORT_IF_FALSE(aScopeObject,
     "Shouldn't call EvaluateStringWithValue with null scope object.");
 
   NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
 
   if (!mScriptsEnabled) {
     if (aIsUndefined) {
@@ -1417,19 +1413,16 @@ nsJSContext::EvaluateString(const nsAStr
                             nsIPrincipal *aPrincipal,
                             nsIPrincipal *aOriginPrincipal,
                             const char *aURL,
                             uint32_t aLineNo,
                             JSVersion aVersion,
                             nsAString *aRetValue,
                             bool* aIsUndefined)
 {
-  NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (url: %s, line: %d)", MOZ_FUNCTION_NAME,
-                           __LINE__, aURL, aLineNo);
-
   SAMPLE_LABEL("JS", "EvaluateString");
   NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
 
   if (!mScriptsEnabled) {
     if (aIsUndefined) {
       *aIsUndefined = true;
     }
 
@@ -1734,19 +1727,16 @@ nsresult
 nsJSContext::CompileEventHandler(nsIAtom *aName,
                                  uint32_t aArgCount,
                                  const char** aArgNames,
                                  const nsAString& aBody,
                                  const char *aURL, uint32_t aLineNo,
                                  uint32_t aVersion,
                                  nsScriptObjectHolder<JSObject>& aHandler)
 {
-  NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (url: %s, line: %d)", MOZ_FUNCTION_NAME,
-                           __LINE__, aURL, aLineNo);
-
   NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
 
   NS_PRECONDITION(AtomIsEventHandlerName(aName), "Bad event name");
   NS_PRECONDITION(!::JS_IsExceptionPending(mContext),
                   "Why are we being called with a pending exception?");
 
   if (!sSecurityManager) {
     NS_ERROR("Huh, we need a script security manager to compile "
@@ -1796,19 +1786,16 @@ nsJSContext::CompileFunction(JSObject* a
                              const char** aArgArray,
                              const nsAString& aBody,
                              const char* aURL,
                              uint32_t aLineNo,
                              uint32_t aVersion,
                              bool aShared,
                              JSObject** aFunctionObject)
 {
-  NS_TIME_FUNCTION_FMT(1.0, "%s (line %d) (function: %s, url: %s, line: %d)", MOZ_FUNCTION_NAME,
-                       __LINE__, aName.BeginReading(), aURL, aLineNo);
-
   NS_ABORT_IF_FALSE(aFunctionObject,
     "Shouldn't call CompileFunction with null return value.");
 
   NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
 
   // Don't compile if aVersion is unknown.  Since the caller is responsible for
   // parsing the version strings, we just check it isn't JSVERSION_UNKNOWN.
   if ((JSVersion)aVersion == JSVERSION_UNKNOWN) {
@@ -1855,27 +1842,16 @@ nsJSContext::CallEventHandler(nsISupport
                               nsIVariant** arv)
 {
   NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
 
   if (!mScriptsEnabled) {
     return NS_OK;
   }
 
-#ifdef NS_FUNCTION_TIMER
-  {
-    JSObject *obj = aHandler;
-    if (js::IsFunctionProxy(obj))
-      obj = js::UnwrapObject(obj);
-    JSString *id = JS_GetFunctionId(static_cast<JSFunction *>(JS_GetPrivate(obj)));
-    JSAutoByteString bytes;
-    const char *name = !id ? "anonymous" : bytes.encode(mContext, id) ? bytes.ptr() : "<error>";
-    NS_TIME_FUNCTION_FMT(1.0, "%s (line %d) (function: %s)", MOZ_FUNCTION_NAME, __LINE__, name);
-  }
-#endif
   SAMPLE_LABEL("JS", "CallEventHandler");
 
   nsAutoMicroTask mt;
   xpc_UnmarkGrayObject(aScope);
   xpc_UnmarkGrayObject(aHandler);
 
   XPCAutoRequest ar(mContext);
   JSObject* target = nullptr;
@@ -2017,18 +1993,16 @@ nsJSContext::Serialize(nsIObjectOutputSt
   return nsContentUtils::XPConnect()->WriteScript(aStream, mContext,
                                                   xpc_UnmarkGrayScript(aScriptObject));
 }
 
 nsresult
 nsJSContext::Deserialize(nsIObjectInputStream* aStream,
                          nsScriptObjectHolder<JSScript>& aResult)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-  
   JSScript *script;
   nsresult rv = nsContentUtils::XPConnect()->ReadScript(aStream, mContext, &script);
   if (NS_FAILED(rv)) return rv;
     
   return aResult.set(script);
 }
 
 nsIScriptGlobalObject *
@@ -2903,17 +2877,16 @@ FullGCTimerFired(nsITimer* aTimer, void*
 //static
 void
 nsJSContext::GarbageCollectNow(js::gcreason::Reason aReason,
                                IsIncremental aIncremental,
                                IsCompartment aCompartment,
                                IsShrinking aShrinking,
                                int64_t aSliceMillis)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
   SAMPLE_LABEL("GC", "GarbageCollectNow");
 
   MOZ_ASSERT_IF(aSliceMillis, aIncremental == IncrementalGC);
 
   KillGCTimer();
   KillShrinkGCBuffersTimer();
 
   // Reset sPendingLoadCount in case the timer that fired was a
@@ -2971,17 +2944,16 @@ nsJSContext::GarbageCollectNow(js::gcrea
     js::GCForReason(nsJSRuntime::sRuntime, aReason);
   }
 }
 
 //static
 void
 nsJSContext::ShrinkGCBuffersNow()
 {
-  NS_TIME_FUNCTION_MIN(1.0);
   SAMPLE_LABEL("GC", "ShrinkGCBuffersNow");
 
   KillShrinkGCBuffersTimer();
 
   JS_ShrinkGCBuffers(nsJSRuntime::sRuntime);
 }
 
 // Return true if any JSContext has a "global object" with a gray
@@ -3074,17 +3046,16 @@ nsJSContext::CycleCollectNow(nsICycleCol
 
   if (sCCLockedOut) {
     // We're in the middle of an incremental GC; finish it first
     js::PrepareForIncrementalGC(nsJSRuntime::sRuntime);
     js::FinishIncrementalGC(nsJSRuntime::sRuntime, js::gcreason::CC_FORCED);
   }
 
   SAMPLE_LABEL("GC", "CycleCollectNow");
-  NS_TIME_FUNCTION_MIN(1.0);
 
   KillCCTimer();
 
   PRTime start = PR_Now();
 
   uint32_t suspected = nsCycleCollector_suspectedCount();
 
   // nsCycleCollector_forgetSkippable may mark some gray js to black.
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -18,17 +18,16 @@
 #include "InsertElementTxn.h"           // for InsertElementTxn
 #include "InsertTextTxn.h"              // for InsertTextTxn
 #include "JoinElementTxn.h"             // for JoinElementTxn
 #include "PlaceholderTxn.h"             // for PlaceholderTxn
 #include "SplitElementTxn.h"            // for SplitElementTxn
 #include "mozFlushType.h"               // for mozFlushType::Flush_Frames
 #include "mozISpellCheckingEngine.h"
 #include "mozInlineSpellChecker.h"      // for mozInlineSpellChecker
-#include "mozilla/FunctionTimer.h"      // for NS_TIME_FUNCTION
 #include "mozilla/Preferences.h"        // for Preferences
 #include "mozilla/Selection.h"          // for Selection, etc
 #include "mozilla/Services.h"           // for GetObserverService
 #include "mozilla/Util.h"               // for DebugOnly
 #include "mozilla/dom/Element.h"        // for Element, nsINode::AsElement
 #include "mozilla/mozalloc.h"           // for operator new, etc
 #include "nsAString.h"                  // for nsAString_internal::Length, etc
 #include "nsCCUncollectableMarker.h"    // for nsCCUncollectableMarker
@@ -1306,18 +1305,16 @@ NS_IMETHODIMP nsEditor::Observe(nsISuppo
     mInlineSpellChecker->SpellCheckRange(nullptr); // causes recheck
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsEditor::SyncRealTimeSpell()
 {
-  NS_TIME_FUNCTION;
-
   bool enable = GetDesiredSpellCheckState();
 
   // Initializes mInlineSpellChecker
   nsCOMPtr<nsIInlineSpellChecker> spellChecker;
   GetInlineSpellChecker(enable, getter_AddRefs(spellChecker));
 
   if (mInlineSpellChecker) {
     // We might have a mInlineSpellChecker even if there are no dictionaries
--- a/editor/libeditor/text/nsPlaintextEditor.cpp
+++ b/editor/libeditor/text/nsPlaintextEditor.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "mozilla/Assertions.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Selection.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/mozalloc.h"
 #include "nsAString.h"
 #include "nsAutoPtr.h"
 #include "nsCRT.h"
 #include "nsCaret.h"
@@ -113,18 +112,16 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_
 NS_INTERFACE_MAP_END_INHERITING(nsEditor)
 
 
 NS_IMETHODIMP nsPlaintextEditor::Init(nsIDOMDocument *aDoc, 
                                       nsIContent *aRoot,
                                       nsISelectionController *aSelCon,
                                       uint32_t aFlags)
 {
-  NS_TIME_FUNCTION;
-
   NS_PRECONDITION(aDoc, "bad arg");
   NS_ENSURE_TRUE(aDoc, NS_ERROR_NULL_POINTER);
   
   nsresult res = NS_OK, rulesRes = NS_OK;
   
   if (1)
   {
     // block to scope nsAutoEditInitRulesTrigger
--- a/embedding/components/appstartup/src/nsAppStartupNotifier.cpp
+++ b/embedding/components/appstartup/src/nsAppStartupNotifier.cpp
@@ -7,47 +7,42 @@
 #include "nsString.h"
 #include "nsXPIDLString.h"
 #include "nsIServiceManager.h"
 #include "nsICategoryManager.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsAppStartupNotifier.h"
 
-#include "mozilla/FunctionTimer.h"
 
 NS_IMPL_ISUPPORTS1(nsAppStartupNotifier, nsIObserver)
 
 nsAppStartupNotifier::nsAppStartupNotifier()
 {
 }
 
 nsAppStartupNotifier::~nsAppStartupNotifier()
 {
 }
 
 NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
 {
-    NS_TIME_FUNCTION;
-
     NS_ENSURE_ARG(aTopic);
     nsresult rv;
 
     // now initialize all startup listeners
     nsCOMPtr<nsICategoryManager> categoryManager =
                     do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsISimpleEnumerator> enumerator;
     rv = categoryManager->EnumerateCategory(aTopic,
                                getter_AddRefs(enumerator));
     if (NS_FAILED(rv)) return rv;
 
-    NS_TIME_FUNCTION_MARK("EnumerateCategory");
-
     nsCOMPtr<nsISupports> entry;
     while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(entry)))) {
         nsCOMPtr<nsISupportsCString> category = do_QueryInterface(entry, &rv);
 
         if (NS_SUCCEEDED(rv)) {
             nsAutoCString categoryEntry;
             rv = category->GetData(categoryEntry);
 
@@ -82,16 +77,14 @@ NS_IMETHODIMP nsAppStartupNotifier::Obse
                 else {
                   #ifdef DEBUG
                     nsAutoCString warnStr("Cannot create startup observer : ");
                     warnStr += contractId.get();
                     NS_WARNING(warnStr.get());
                   #endif
                 }
 
-                NS_TIME_FUNCTION_MARK("observer: category: %s cid: %s", categoryEntry.get(), nsPromiseFlatCString(contractId).get());
-
             }
         }
     }
 
     return NS_OK;
 }
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -60,17 +60,16 @@
 #include "nsCRT.h"
 #include "GLContext.h"
 #include "GLContextProvider.h"
 
 #ifdef MOZ_WIDGET_ANDROID
 #include "TexturePoolOGL.h"
 #endif
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Attributes.h"
 
 #include "nsIGfxInfo.h"
 
 using namespace mozilla;
 using namespace mozilla::layers;
@@ -1356,18 +1355,16 @@ gfxPlatform::GetPlatformCMSOutputProfile
 {
     return nullptr;
 }
 
 qcms_profile *
 gfxPlatform::GetCMSOutputProfile()
 {
     if (!gCMSOutputProfile) {
-        NS_TIME_FUNCTION;
-
         /* Determine if we're using the internal override to force sRGB as
            an output profile for reftests. See Bug 452125.
 
            Note that we don't normally (outside of tests) set a
            default value of this preference, which means nsIPrefBranch::GetBoolPref
            will typically throw (and leave its out-param untouched).
          */
         if (Preferences::GetBool("gfx.color_management.force_srgb", false)) {
--- a/gfx/thebes/gfxPlatformFontList.h
+++ b/gfx/thebes/gfxPlatformFontList.h
@@ -10,17 +10,16 @@
 #include "nsRefPtrHashtable.h"
 #include "nsTHashtable.h"
 
 #include "gfxFontUtils.h"
 #include "gfxFont.h"
 #include "gfxPlatform.h"
 
 #include "nsIMemoryReporter.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Attributes.h"
 
 class CharMapHashKey : public PLDHashEntryHdr
 {
 public:
     typedef gfxCharacterMap* KeyType;
     typedef const gfxCharacterMap* KeyTypePointer;
 
@@ -84,18 +83,16 @@ struct FontListSizes {
 class gfxPlatformFontList : protected gfxFontInfoLoader
 {
 public:
     static gfxPlatformFontList* PlatformFontList() {
         return sPlatformFontList;
     }
 
     static nsresult Init() {
-        NS_TIME_FUNCTION;
-
         NS_ASSERTION(!sPlatformFontList, "What's this doing here?");
         gfxPlatform::GetPlatform()->CreatePlatformFontList();
         if (!sPlatformFontList) {
             return NS_ERROR_OUT_OF_MEMORY;
         }
         return NS_OK;
     }
 
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Attributes.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Preferences.h"
 
 #include "ImageLogging.h"
 #include "imgLoader.h"
 #include "imgRequestProxy.h"
 
 #include "RasterImage.h"
 /* We end up pulling in windows.h because we eventually hit gfxWindowsSurface;
@@ -863,18 +862,16 @@ void imgLoader::GlobalInit()
 
   sMemReporter = new imgMemoryReporter();
   NS_RegisterMemoryMultiReporter(sMemReporter);
   NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(ImagesContentUsedUncompressed));
 }
 
 nsresult imgLoader::InitCache()
 {
-  NS_TIME_FUNCTION;
-
   nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
   if (!os)
     return NS_ERROR_FAILURE;
 
   os->AddObserver(this, "memory-pressure", false);
   os->AddObserver(this, "chrome-flush-skin-caches", false);
   os->AddObserver(this, "chrome-flush-caches", false);
   os->AddObserver(this, "last-pb-context-exited", false);
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -63,17 +63,16 @@
 
 #include "mozilla/scache/StartupCache.h"
 #include "mozilla/scache/StartupCacheUtils.h"
 #include "mozilla/Omnijar.h"
 #include "mozilla/Preferences.h"
 
 #include "jsdbgapi.h"
 
-#include "mozilla/FunctionTimer.h"
 
 using namespace mozilla;
 using namespace mozilla::scache;
 using namespace xpc;
 
 static const char kJSRuntimeServiceContractID[] = "@mozilla.org/js/xpc/RuntimeService;1";
 static const char kXPConnectServiceContractID[] = "@mozilla.org/js/xpc/XPConnect;1";
 static const char kObserverServiceContractID[] = "@mozilla.org/observer-service;1";
@@ -383,17 +382,16 @@ mozJSComponentLoader::sSelf;
 NS_IMPL_ISUPPORTS3(mozJSComponentLoader,
                    mozilla::ModuleLoader,
                    xpcIJSModuleLoader,
                    nsIObserver)
 
 nsresult
 mozJSComponentLoader::ReallyInit()
 {
-    NS_TIME_FUNCTION;
     nsresult rv;
 
 
     /*
      * Get the JSRuntime from the runtime svc, if possible.
      * We keep a reference around, because it's a Bad Thing if the runtime
      * service gets shut down before we're done.  Bad!
      */
@@ -459,21 +457,16 @@ mozJSComponentLoader::LoadModule(FileLoc
     nsCString spec;
     aFile.GetURIString(spec);
 
     nsCOMPtr<nsIURI> uri;
     nsresult rv = NS_NewURI(getter_AddRefs(uri), spec);
     if (NS_FAILED(rv))
         return NULL;
 
-#ifdef NS_FUNCTION_TIMER
-    NS_TIME_FUNCTION_FMT("%s (line %d) (file: %s)", MOZ_FUNCTION_NAME,
-                         __LINE__, spec.get());
-#endif
-
     if (!mInitialized) {
         rv = ReallyInit();
         if (NS_FAILED(rv))
             return NULL;
     }
 
     ModuleEntry* mod;
     if (mModules.Get(spec, &mod))
@@ -969,19 +962,16 @@ mozJSComponentLoader::UnloadModules()
 
 NS_IMETHODIMP
 mozJSComponentLoader::Import(const nsACString& registryLocation,
                              const JS::Value& targetVal_,
                              JSContext* cx,
                              uint8_t optionalArgc,
                              JS::Value* retval)
 {
-    NS_TIME_FUNCTION_FMT("%s (line %d) (file: %s)", MOZ_FUNCTION_NAME,
-                         __LINE__, registryLocation.BeginReading());
-
     JSAutoRequest ar(cx);
 
     JS::Value targetVal = targetVal_;
     JSObject *targetObject = NULL;
 
     MOZ_ASSERT(nsContentUtils::CallerHasUniversalXPConnect());
     if (optionalArgc) {
         // The caller passed in the optional second argument. Get it.
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -23,17 +23,16 @@
 #include "nsIFileURL.h"
 #include "nsScriptLoader.h"
 
 #include "jsapi.h"
 #include "jsdbgapi.h"
 #include "jsfriendapi.h"
 #include "nsJSPrincipals.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/scache/StartupCache.h"
 #include "mozilla/scache/StartupCacheUtils.h"
 
 using namespace mozilla::scache;
 
 /* load() error msgs, XXX localize? */
 #define LOAD_ERROR_NOSERVICE "Error creating IO Service."
 #define LOAD_ERROR_NOURI "Error creating URI (invalid URL scheme?)"
@@ -150,21 +149,16 @@ mozJSSubScriptLoader::LoadSubScript(cons
      *   target_obj: Optional object to eval the script onto (defaults to context
      *               global)
      *   returns: Whatever jsval the script pointed to by the url returns.
      * Should ONLY (O N L Y !) be called from JavaScript code.
      */
 
     nsresult rv = NS_OK;
 
-#ifdef NS_FUNCTION_TIMER
-    NS_TIME_FUNCTION_FMT("%s (line %d) (url: %s)", MOZ_FUNCTION_NAME,
-                         __LINE__, NS_LossyConvertUTF16toASCII(url).get());
-#endif
-
     /* set the system principal if it's not here already */
     if (!mSystemPrincipal) {
         nsCOMPtr<nsIScriptSecurityManager> secman =
             do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID);
         if (!secman)
             return NS_OK;
 
         rv = secman->GetSystemPrincipal(getter_AddRefs(mSystemPrincipal));
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -12,17 +12,16 @@
 #include "xpcpublic.h"
 #include "XPCJSMemoryReporter.h"
 #include "WrapperFactory.h"
 #include "dom_quickstubs.h"
 
 #include "nsIMemoryReporter.h"
 #include "nsPIDOMWindow.h"
 #include "nsPrintfCString.h"
-#include "mozilla/FunctionTimer.h"
 #include "prsystem.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 
 #include "nsLayoutStatics.h"
 #include "nsContentUtils.h"
 #include "nsCCUncollectableMarker.h"
 #include "jsfriendapi.h"
@@ -2098,17 +2097,16 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* 
    mReleaseRunnable(nullptr),
    mExceptionManagerNotAvailable(false)
 {
 #ifdef XPC_CHECK_WRAPPERS_AT_SHUTDOWN
     DEBUG_WrappedNativeHashtable =
         JS_NewDHashTable(JS_DHashGetStubOps(), nullptr,
                          sizeof(JSDHashEntryStub), 128);
 #endif
-    NS_TIME_FUNCTION;
 
     DOM_InitInterfaces();
     Preferences::AddBoolVarCache(&gNewDOMBindingsEnabled, "dom.new_bindings",
                                  false);
     Preferences::AddBoolVarCache(&gExperimentalBindingsEnabled,
                                  "dom.experimental_bindings",
                                  false);
 
@@ -2220,18 +2218,16 @@ XPCJSRuntime::newXPCJSRuntime(nsXPConnec
 }
 
 // InternStaticDictionaryJSVals is automatically generated.
 bool InternStaticDictionaryJSVals(JSContext* aCx);
 
 JSBool
 XPCJSRuntime::OnJSContextNew(JSContext *cx)
 {
-    NS_TIME_FUNCTION;
-
     // if it is our first context then we need to generate our string ids
     JSBool ok = true;
     if (JSID_IS_VOID(mStrIDs[0])) {
         JS_SetGCParameterForThread(cx, JSGC_MAX_CODE_CACHE_BYTES, 16 * 1024 * 1024);
         {
             // Scope the JSAutoRequest so it goes out of scope before calling
             // mozilla::dom::binding::DefineStaticJSVals.
             JSAutoRequest ar(cx);
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -10,17 +10,16 @@
 #include "nsCOMPtr.h"
 #include "nsCRT.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsISupports.h"
 #include "nsIContent.h"
 #include "nsIContentViewerContainer.h"
 #include "nsIContentViewer.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsIDocumentViewerPrint.h"
 #include "nsIDOMBeforeUnloadEvent.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsStyleSet.h"
 #include "nsIStyleSheet.h"
 #include "nsCSSStyleSheet.h"
@@ -955,17 +954,16 @@ void DocumentViewerImpl::SetNavigationTi
 //   aStatus - The status returned from loading the document.
 //
 // This method is called by the container when the document has been
 // completely loaded.
 //
 NS_IMETHODIMP
 DocumentViewerImpl::LoadComplete(nsresult aStatus)
 {
-  NS_TIME_FUNCTION;
   /* We need to protect ourself against auto-destruction in case the
      window is closed while processing the OnLoad event.  See bug
      http://bugzilla.mozilla.org/show_bug.cgi?id=78445 for more
      explanation.
   */
   nsRefPtr<DocumentViewerImpl> kungFuDeathGrip(this);
 
   // Flush out layout so it's up-to-date by the time onload is called.
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -164,39 +164,24 @@
 #include "nsPlaceholderFrame.h"
 #include "nsCanvasFrame.h"
 
 // Content viewer interfaces
 #include "nsIContentViewer.h"
 #include "imgIEncoder.h"
 #include "gfxPlatform.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 #include "sampler.h"
 #include "mozilla/css/ImageLoader.h"
 
 #include "Layers.h"
 #include "nsAsyncDOMEvent.h"
 
-#ifdef NS_FUNCTION_TIMER
-#define NS_TIME_FUNCTION_DECLARE_DOCURL                \
-  nsAutoCString docURL__("N/A");                       \
-  nsIURI *uri__ = mDocument->GetDocumentURI();         \
-  if (uri__) uri__->GetSpec(docURL__);
-#define NS_TIME_FUNCTION_WITH_DOCURL                   \
-  NS_TIME_FUNCTION_DECLARE_DOCURL                      \
-  NS_TIME_FUNCTION_MIN_FMT(1.0,                        \
-     "%s (line %d) (document: %s)", MOZ_FUNCTION_NAME, \
-     __LINE__, docURL__.get())
-#else
-#define NS_TIME_FUNCTION_WITH_DOCURL do{} while(0)
-#endif
-
 #define ANCHOR_SCROLL_FLAGS (SCROLL_OVERFLOW_HIDDEN | SCROLL_NO_PARENT_FRAMES)
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::layers;
 
 CapturingContentInfo nsIPresShell::gCaptureInfo =
   { false /* mAllowed */, false /* mPointerLock */, false /* mRetargetToElement */,
@@ -776,18 +761,16 @@ PresShell::~PresShell()
  */
 nsresult
 PresShell::Init(nsIDocument* aDocument,
                 nsPresContext* aPresContext,
                 nsIViewManager* aViewManager,
                 nsStyleSet* aStyleSet,
                 nsCompatibility aCompatMode)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   NS_PRECONDITION(nullptr != aDocument, "null ptr");
   NS_PRECONDITION(nullptr != aPresContext, "null ptr");
   NS_PRECONDITION(nullptr != aViewManager, "null ptr");
   nsresult result;
 
   if ((nullptr == aDocument) || (nullptr == aPresContext) ||
       (nullptr == aViewManager)) {
     return NS_ERROR_NULL_POINTER;
@@ -913,18 +896,16 @@ PresShell::Init(nsIDocument* aDocument,
   SetupFontInflation();
 
   return NS_OK;
 }
 
 void
 PresShell::Destroy()
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
     "destroy called on presshell while scripts not blocked");
 
 #ifdef MOZ_REFLOW_PERF
   DumpReflows();
   if (mReflowCountMgr) {
     delete mReflowCountMgr;
     mReflowCountMgr = nullptr;
@@ -1110,18 +1091,16 @@ bool
 nsIPresShell::GetAuthorStyleDisabled() const
 {
   return mStyleSet->GetAuthorStyleDisabled();
 }
 
 nsresult
 PresShell::SetPreferenceStyleRules(bool aForceReflow)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   if (!mDocument) {
     return NS_ERROR_NULL_POINTER;
   }
 
   nsPIDOMWindow *window = mDocument->GetWindow();
 
   // If the document doesn't have a window there's no need to notify
   // its presshell about changes to preferences since the document is
@@ -1201,18 +1180,16 @@ nsresult PresShell::ClearPreferenceStyle
     }
   }
   return result;
 }
 
 nsresult
 PresShell::CreatePreferenceStyleSheet()
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   NS_ASSERTION(!mPrefStyleSheet, "prefStyleSheet already exists");
   mPrefStyleSheet = new nsCSSStyleSheet(CORS_NONE);
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), "about:PreferenceStyleSheet", nullptr);
   if (NS_FAILED(rv)) {
     mPrefStyleSheet = nullptr;
     return rv;
   }
@@ -1242,18 +1219,16 @@ PresShell::CreatePreferenceStyleSheet()
 // XXX We want these after the @namespace rules.  Does order matter
 // for these rules, or can we call StyleRule::StyleRuleCount()
 // and just "append"?
 static uint32_t sInsertPrefSheetRulesAt = 2;
 
 nsresult
 PresShell::SetPrefNoScriptRule()
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   nsresult rv = NS_OK;
 
   // also handle the case where print is done from print preview
   // see bug #342439 for more details
   nsIDocument* doc = mDocument;
   if (doc->IsStaticDocument()) {
     doc = doc->GetOriginalDocument();
   }
@@ -1271,18 +1246,16 @@ PresShell::SetPrefNoScriptRule()
                          sInsertPrefSheetRulesAt, &index);
   }
 
   return rv;
 }
 
 nsresult PresShell::SetPrefNoFramesRule(void)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   NS_ASSERTION(mPresContext,"null prescontext not allowed");
   if (!mPresContext) {
     return NS_ERROR_FAILURE;
   }
 
   nsresult rv = NS_OK;
   
   if (!mPrefStyleSheet) {
@@ -1308,18 +1281,16 @@ nsresult PresShell::SetPrefNoFramesRule(
       InsertRuleInternal(NS_LITERAL_STRING("frame, frameset, iframe {display:none!important}"),
                          sInsertPrefSheetRulesAt, &index);
   }
   return rv;
 }
   
 nsresult PresShell::SetPrefLinkRules(void)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   NS_ASSERTION(mPresContext,"null prescontext not allowed");
   if (!mPresContext) {
     return NS_ERROR_FAILURE;
   }
 
   nsresult rv = NS_OK;
   
   if (!mPrefStyleSheet) {
@@ -1385,18 +1356,16 @@ nsresult PresShell::SetPrefLinkRules(voi
                          sInsertPrefSheetRulesAt, &index);
   }
 
   return rv;          
 }
 
 nsresult PresShell::SetPrefFocusRules(void)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   NS_ASSERTION(mPresContext,"null prescontext not allowed");
   nsresult result = NS_OK;
 
   if (!mPresContext)
     result = NS_ERROR_FAILURE;
 
   if (NS_SUCCEEDED(result) && !mPrefStyleSheet)
     result = CreatePreferenceStyleSheet();
@@ -1623,17 +1592,16 @@ PresShell::Initialize(nscoord aWidth, ns
     return NS_OK;
   }
 
   if (!mDocument) {
     // Nothing to do
     return NS_OK;
   }
 
-  NS_TIME_FUNCTION_WITH_DOCURL;
   mozilla::TimeStamp timerStart = mozilla::TimeStamp::Now();
 
   NS_ASSERTION(!mDidInitialize, "Why are we being called?");
 
   nsCOMPtr<nsIPresShell> kungFuDeathGrip(this);
   mDidInitialize = true;
 
 #ifdef DEBUG
@@ -1704,18 +1672,16 @@ PresShell::Initialize(nscoord aWidth, ns
     }
 
     // nsAutoScriptBlocker going out of scope may have killed us too
     NS_ENSURE_STATE(!mHaveShutDown);
 
     // Run the XBL binding constructors for any new frames we've constructed
     mDocument->BindingManager()->ProcessAttachedQueue();
 
-    NS_TIME_FUNCTION_MARK("XBL binding constructors fired");
-
     // Constructors may have killed us too
     NS_ENSURE_STATE(!mHaveShutDown);
 
     // Now flush out pending restyles before we actually reflow, in
     // case XBL constructors changed styles somewhere.
     {
       nsAutoScriptBlocker scriptBlocker;
       mFrameConstructor->CreateNeededFrames();
@@ -1966,18 +1932,16 @@ PresShell::SetIgnoreFrameDestruction(boo
     mDocument->StyleImageLoader()->ClearAll();
   }
   mIgnoreFrameDestruction = aIgnore;
 }
 
 void
 PresShell::NotifyDestroyingFrame(nsIFrame* aFrame)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   if (!mIgnoreFrameDestruction) {
     mDocument->StyleImageLoader()->DropRequestsForFrame(aFrame);
 
     mFrameConstructor->NotifyDestroyingFrame(aFrame);
 
     for (int32_t idx = mDirtyRoots.Length(); idx; ) {
       --idx;
       if (mDirtyRoots[idx] == aFrame) {
@@ -2470,25 +2434,16 @@ PresShell::VerifyHasDirtyRootAncestor(ns
                 "reflowed?");
 }
 #endif
 
 void
 PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
                             nsFrameState aBitToAdd)
 {
-#ifdef NS_FUNCTION_TIMER
-  NS_TIME_FUNCTION_DECLARE_DOCURL;
-  nsAutoCString frameType__("N/A");
-  nsIAtom *atomType__ = aFrame ? aFrame->GetType() : nullptr;
-  if (atomType__) atomType__->ToUTF8String(frameType__);
-  NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (document: %s, frame type: %s)", MOZ_FUNCTION_NAME,
-                           __LINE__, docURL__.get(), frameType__.get());
-#endif
-
   NS_PRECONDITION(aBitToAdd == NS_FRAME_IS_DIRTY ||
                   aBitToAdd == NS_FRAME_HAS_DIRTY_CHILDREN,
                   "Unexpected bits being added");
   NS_PRECONDITION(aIntrinsicDirty != eStyleChange ||
                   aBitToAdd == NS_FRAME_IS_DIRTY,
                   "bits don't correspond to style change reason");
 
   NS_ASSERTION(!mIsReflowing, "can't mark frame dirty during reflow");
@@ -2698,18 +2653,16 @@ PresShell::CancelAllPendingReflows()
   }
 
   ASSERT_REFLOW_SCHEDULED_STATE();
 }
 
 nsresult
 PresShell::RecreateFramesFor(nsIContent* aContent)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   NS_ENSURE_TRUE(mPresContext, NS_ERROR_FAILURE);
   if (!mDidInitialize) {
     // Nothing to do here.  In fact, if we proceed and aContent is the
     // root we will crash.
     return NS_OK;
   }
 
   // Don't call RecreateFramesForContent since that is not exported and we want
@@ -2762,18 +2715,16 @@ PresShell::ClearFrameRefs(nsIFrame* aFra
     }
     weakFrame = prev;
   }
 }
 
 already_AddRefed<nsRenderingContext>
 PresShell::GetReferenceRenderingContext()
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   nsDeviceContext* devCtx = mPresContext->DeviceContext();
   nsRefPtr<nsRenderingContext> rc;
   if (mPresContext->IsScreen()) {
     rc = new nsRenderingContext();
     rc->Init(devCtx, gfxPlatform::GetPlatform()->ScreenReferenceSurface());
   } else {
     devCtx->CreateRenderingContext(*getter_AddRefs(rc));
   }
@@ -3507,18 +3458,16 @@ nsIPresShell::ClearMouseCapture(nsIFrame
     NS_RELEASE(gCaptureInfo.mContent);
     gCaptureInfo.mAllowed = false;
   }
 }
 
 nsresult
 PresShell::CaptureHistoryState(nsILayoutHistoryState** aState, bool aLeavingPage)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   nsresult rv = NS_OK;
 
   NS_PRECONDITION(nullptr != aState, "null state pointer");
 
   // We actually have to mess with the docshell here, since we want to
   // store the state back in it.
   // XXXbz this isn't really right, since this is being called in the
   // content viewer's Hide() method...  by that point the docshell's
@@ -3760,29 +3709,16 @@ void
 PresShell::FlushPendingNotifications(mozFlushType aType)
 {
   /**
    * VERY IMPORTANT: If you add some sort of new flushing to this
    * method, make sure to add the relevant SetNeedLayoutFlush or
    * SetNeedStyleFlush calls on the document.
    */
 
-#ifdef NS_FUNCTION_TIMER
-  NS_TIME_FUNCTION_DECLARE_DOCURL;
-  static const char *flushTypeNames[] = {
-    "Flush_Content",
-    "Flush_ContentAndNotify",
-    "Flush_Styles",
-    "Flush_InterruptibleLayout",
-    "Flush_Layout",
-    "Flush_Display"
-  };
-  NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (document: %s, type: %s)", MOZ_FUNCTION_NAME,
-                           __LINE__, docURL__.get(), flushTypeNames[aType - 1]);
-#endif
   SAMPLE_LABEL("layout", "FlushPendingNotifications");
 
 #ifdef ACCESSIBILITY
 #ifdef DEBUG
   nsAccessibilityService* accService = GetAccService();
   if (accService) {
     NS_ASSERTION(!accService->IsProcessingRefreshDriverNotification(),
                  "Flush during accessible tree update!");
@@ -4276,18 +4212,16 @@ PresShell::GetPlaceholderFrameFor(nsIFra
   return mFrameConstructor->GetPlaceholderFrameFor(aFrame);
 }
 
 nsresult
 PresShell::RenderDocument(const nsRect& aRect, uint32_t aFlags,
                           nscolor aBackgroundColor,
                           gfxContext* aThebesContext)
 {
-  NS_TIME_FUNCTION_WITH_DOCURL;
-
   NS_ENSURE_TRUE(!(aFlags & RENDER_IS_UNTRUSTED), NS_ERROR_NOT_IMPLEMENTED);
 
   nsRootPresContext* rootPresContext = mPresContext->GetRootPresContext();
   if (rootPresContext) {
     rootPresContext->FlushWillPaintObservers();
     if (mIsDestroying)
       return NS_OK;
   }
@@ -4421,18 +4355,16 @@ PresShell::RenderDocument(const nsRect& 
  * Clip the display list aList to a range. Returns the clipped
  * rectangle surrounding the range.
  */
 nsRect
 PresShell::ClipListToRange(nsDisplayListBuilder *aBuilder,
                            nsDisplayList* aList,
                            nsRange* aRange)
 {
-  NS_TIME_FUNCTION_WITH_DOCURL;
-
   // iterate though the display items and add up the bounding boxes of each.
   // This will allow the total area of the frames within the range to be
   // determined. To do this, remove an item from the bottom of the list, check
   // whether it should be part of the range, and if so, append it to the top
   // of the temporary list tmpList. If the item is a text frame at the end of
   // the selection range, wrap it in an nsDisplayClip to clip the display to
   // the portion of the text frame that is part of the selection. Then, append
   // the wrapper to the top of the list. Otherwise, just delete the item and
@@ -4528,18 +4460,16 @@ PresShell::ClipListToRange(nsDisplayList
 static bool gDumpRangePaintList = false;
 #endif
 
 RangePaintInfo*
 PresShell::CreateRangePaintInfo(nsIDOMRange* aRange,
                                 nsRect& aSurfaceRect,
                                 bool aForPrimarySelection)
 {
-  NS_TIME_FUNCTION_WITH_DOCURL;
-
   RangePaintInfo* info = nullptr;
 
   nsRange* range = static_cast<nsRange*>(aRange);
 
   nsIFrame* ancestorFrame;
   nsIFrame* rootFrame = GetRootFrame();
 
   // If the start or end of the range is the document, just use the root
@@ -4615,18 +4545,16 @@ PresShell::CreateRangePaintInfo(nsIDOMRa
 already_AddRefed<gfxASurface>
 PresShell::PaintRangePaintInfo(nsTArray<nsAutoPtr<RangePaintInfo> >* aItems,
                                nsISelection* aSelection,
                                nsIntRegion* aRegion,
                                nsRect aArea,
                                nsIntPoint& aPoint,
                                nsIntRect* aScreenRect)
 {
-  NS_TIME_FUNCTION_WITH_DOCURL;
-
   nsPresContext* pc = GetPresContext();
   if (!pc || aArea.width == 0 || aArea.height == 0)
     return nullptr;
 
   nsDeviceContext* deviceContext = pc->DeviceContext();
 
   // use the rectangle to create the surface
   nsIntRect pixelArea = aArea.ToOutsidePixels(pc->AppUnitsPerDevPixel());
@@ -5246,27 +5174,16 @@ private:
 };
 
 void
 PresShell::Paint(nsIView*           aViewToPaint,
                  const nsRegion&    aDirtyRegion,
                  PaintType          aType,
                  bool               aWillSendDidPaint)
 {
-#ifdef NS_FUNCTION_TIMER
-  NS_TIME_FUNCTION_DECLARE_DOCURL;
-  const nsRect& bounds__ = aDirtyRegion.GetBounds();
-  NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (document: %s, dirty rect: (<%f, %f>, <%f, %f>)",
-                           MOZ_FUNCTION_NAME, __LINE__, docURL__.get(),
-                           NSCoordToFloat(bounds__.x),
-                           NSCoordToFloat(bounds__.y),
-                           NSCoordToFloat(bounds__.XMost()),
-                           NSCoordToFloat(bounds__.YMost()));
-#endif
-
   SAMPLE_LABEL("Paint", "PresShell::Paint");
   NS_ASSERTION(!mIsDestroying, "painting a destroyed PresShell");
   NS_ASSERTION(aViewToPaint, "null view");
 
   nsAutoNotifyDidPaint notifyDidPaint(aWillSendDidPaint);
 
   nsPresContext* presContext = GetPresContext();
   AUTO_LAYOUT_PHASE_ENTRY_POINT(presContext, Paint);
@@ -5673,18 +5590,16 @@ PresShell::HandleEvent(nsIFrame        *
     return NS_OK;
   }
 
   RecordMouseLocation(aEvent);
 
   if (!nsContentUtils::IsSafeToRunScript())
     return NS_OK;
 
-  NS_TIME_FUNCTION_MIN(1.0);
-
   nsIContent* capturingContent =
     NS_IS_MOUSE_EVENT(aEvent) || aEvent->eventStructType == NS_WHEEL_EVENT ?
       GetCapturingContent() : nullptr;
 
   nsCOMPtr<nsIDocument> retargetEventDoc;
   if (!aDontRetargetEvents) {
     // key and IME related events should not cross top level window boundary.
     // Basically, such input events should be fired only on focused widget.
@@ -6269,18 +6184,16 @@ static bool CanHandleContextMenuEvent(ns
   }
 #endif
   return true;
 }
 
 nsresult
 PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
 {
-  NS_TIME_FUNCTION_MIN(1.0);
-
   nsRefPtr<nsEventStateManager> manager = mPresContext->EventStateManager();
   nsresult rv = NS_OK;
 
   if (!NS_EVENT_NEEDS_FRAME(aEvent) || GetCurrentEventFrame()) {
     bool touchIsNew = false;
     bool isHandlingUserInput = false;
 
     // XXX How about IME events and input events for plugins?
@@ -7348,18 +7261,16 @@ PresShell::ScheduleReflowOffTimer()
     }
   }
   return true;
 }
 
 bool
 PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
 {
-  NS_TIME_FUNCTION_WITH_DOCURL;
-
   nsAutoCString docURL("N/A");
   nsIURI *uri = mDocument->GetDocumentURI();
   if (uri)
     uri->GetSpec(docURL);
   SAMPLE_LABEL_PRINTF("layout", "DoReflow", "(%s)", docURL.get());
 
   if (mReflowContinueTimer) {
     mReflowContinueTimer->Cancel();
@@ -7545,17 +7456,16 @@ PresShell::DoVerifyReflow()
 bool
 PresShell::ProcessReflowCommands(bool aInterruptible)
 {
   if (mDirtyRoots.IsEmpty() && !mShouldUnsuppressPainting) {
     // Nothing to do; bail out
     return true;
   }
 
-  NS_TIME_FUNCTION_WITH_DOCURL;
   mozilla::TimeStamp timerStart = mozilla::TimeStamp::Now();
   bool interrupted = false;
   if (!mDirtyRoots.IsEmpty()) {
 
 #ifdef DEBUG
     if (VERIFY_REFLOW_DUMP_COMMANDS & gVerifyReflowFlags) {
       printf("ProcessReflowCommands: begin incremental reflow\n");
     }
--- a/layout/build/nsContentDLF.cpp
+++ b/layout/build/nsContentDLF.cpp
@@ -26,17 +26,16 @@
 #ifdef MOZ_MEDIA
 #include "nsHTMLMediaElement.h"
 #endif
 #include "nsContentUtils.h"
 #include "imgILoader.h"
 #include "nsCharsetSource.h"
 #include "nsMimeTypes.h"
 
-#include "mozilla/FunctionTimer.h"
 
 // plugins
 #include "nsIPluginHost.h"
 #include "nsPluginHost.h"
 static NS_DEFINE_CID(kPluginDocumentCID, NS_PLUGINDOCUMENT_CID);
 
 // Factory code for creating variations on html documents
 
@@ -140,26 +139,16 @@ nsContentDLF::CreateInstance(const char*
                              nsIChannel* aChannel,
                              nsILoadGroup* aLoadGroup,
                              const char* aContentType, 
                              nsISupports* aContainer,
                              nsISupports* aExtraInfo,
                              nsIStreamListener** aDocListener,
                              nsIContentViewer** aDocViewer)
 {
-#ifdef NS_FUNCTION_TIMER
-  nsAutoCString channelURL__("N/A");
-  nsCOMPtr<nsIURI> url__;
-  if (aChannel && NS_SUCCEEDED(aChannel->GetURI(getter_AddRefs(url__)))) {
-    url__->GetSpec(channelURL__);
-  }
-  NS_TIME_FUNCTION_FMT("%s (line %d) (url: %s)", MOZ_FUNCTION_NAME,
-                       __LINE__, channelURL__.get());
-#endif
-
   // Declare "type" here.  This is because although the variable itself only
   // needs limited scope, we need to use the raw string memory -- as returned
   // by "type.get()" farther down in the function.
   nsAutoCString type;
 
   // Are we viewing source?
   nsCOMPtr<nsIViewSourceChannel> viewSourceChannel = do_QueryInterface(aChannel);
   if (viewSourceChannel)
@@ -292,35 +281,31 @@ nsContentDLF::CreateInstance(const char*
 
 
 NS_IMETHODIMP
 nsContentDLF::CreateInstanceForDocument(nsISupports* aContainer,
                                         nsIDocument* aDocument,
                                         const char *aCommand,
                                         nsIContentViewer** aContentViewer)
 {
-  NS_TIME_FUNCTION;
-
   nsCOMPtr<nsIContentViewer> contentViewer;
   nsresult rv = NS_NewContentViewer(getter_AddRefs(contentViewer));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Bind the document to the Content Viewer
   rv = contentViewer->LoadStart(aDocument);
   contentViewer.forget(aContentViewer);
   return rv;
 }
 
 NS_IMETHODIMP
 nsContentDLF::CreateBlankDocument(nsILoadGroup *aLoadGroup,
                                   nsIPrincipal* aPrincipal,
                                   nsIDocument **aDocument)
 {
-  NS_TIME_FUNCTION;
-
   *aDocument = nullptr;
 
   nsresult rv = NS_ERROR_FAILURE;
 
   // create a new blank HTML document
   nsCOMPtr<nsIDocument> blankDoc(do_CreateInstance(kHTMLDocumentCID));
 
   if (blankDoc) {
@@ -391,18 +376,16 @@ nsresult
 nsContentDLF::CreateDocument(const char* aCommand,
                              nsIChannel* aChannel,
                              nsILoadGroup* aLoadGroup,
                              nsISupports* aContainer,
                              const nsCID& aDocumentCID,
                              nsIStreamListener** aDocListener,
                              nsIContentViewer** aContentViewer)
 {
-  NS_TIME_FUNCTION;
-
   nsresult rv = NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIURI> aURL;
   rv = aChannel->GetURI(getter_AddRefs(aURL));
   if (NS_FAILED(rv)) return rv;
 
 #ifdef NOISY_CREATE_DOC
   if (nullptr != aURL) {
@@ -441,18 +424,16 @@ nsContentDLF::CreateXULDocument(const ch
                                 nsIChannel* aChannel,
                                 nsILoadGroup* aLoadGroup,
                                 const char* aContentType,
                                 nsISupports* aContainer,
                                 nsISupports* aExtraInfo,
                                 nsIStreamListener** aDocListener,
                                 nsIContentViewer** aContentViewer)
 {
-  NS_TIME_FUNCTION;
-
   nsresult rv;
   nsCOMPtr<nsIDocument> doc = do_CreateInstance(kXULDocumentCID, &rv);
   if (NS_FAILED(rv)) return rv;
 
   nsCOMPtr<nsIContentViewer> contentViewer;
   rv = NS_NewContentViewer(getter_AddRefs(contentViewer));
   if (NS_FAILED(rv)) return rv;
 
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -66,17 +66,16 @@
 #include "nsContentCreatorFunctions.h"
 #include "nsINativeKeyBindings.h"
 #include "nsIJSContextStack.h"
 #include "nsFocusManager.h"
 #include "nsTextEditRules.h"
 #include "nsPresState.h"
 #include "nsContentList.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Selection.h"
 
 #define DEFAULT_COLUMN_WIDTH 20
 
 using namespace mozilla;
 
 nsIFrame*
 NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
@@ -287,18 +286,16 @@ nsTextControlFrame::EnsureEditorInitiali
   // never get used.  So, now this method is being called lazily only
   // when we actually need an editor.
 
   // Check if this method has been called already.
   // If so, just return early.
   if (mUseEditor)
     return NS_OK;
 
-  NS_TIME_FUNCTION;
-
   nsIDocument* doc = mContent->GetCurrentDoc();
   NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
 
   nsWeakFrame weakFrame(this);
 
   // Flush out content on our document.  Have to do this, because script
   // blockers don't prevent the sink flushing out content and notifying in the
   // process, which can destroy frames.
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -60,17 +60,16 @@
 #include "nsIMediaList.h"
 #include "nsIDOMStyleSheet.h"
 #include "nsIDOMCSSStyleSheet.h"
 #include "nsError.h"
 
 #include "nsIChannelPolicy.h"
 #include "nsIContentSecurityPolicy.h"
 
-#include "mozilla/FunctionTimer.h"
 
 /**
  * OVERALL ARCHITECTURE
  *
  * The CSS Loader gets requests to load various sorts of style sheets:
  * inline style from <style> elements, linked style, @import-ed child
  * sheets, non-document sheets.  The loader handles the following tasks:
  *
@@ -1382,23 +1381,16 @@ Loader::LoadSheet(SheetLoadData* aLoadDa
   NS_PRECONDITION(aLoadData, "Need a load data");
   NS_PRECONDITION(aLoadData->mURI, "Need a URI to load");
   NS_PRECONDITION(aLoadData->mSheet, "Need a sheet to load into");
   NS_PRECONDITION(aSheetState != eSheetComplete, "Why bother?");
   NS_PRECONDITION(!aLoadData->mUseSystemPrincipal || aLoadData->mSyncLoad,
                   "Shouldn't use system principal for async loads");
   NS_ASSERTION(mLoadingDatas.IsInitialized(), "mLoadingDatas should be initialized by now.");
 
-#ifdef NS_FUNCTION_TIMER
-  nsAutoCString spec__("N/A");
-  if (aLoadData->mURI) aLoadData->mURI->GetSpec(spec__);
-  NS_TIME_FUNCTION_FMT("Loading stylesheet (url: %s, %ssync)",
-                       spec__.get(), aLoadData->mSyncLoad ? "" : "a");
-#endif
-
   LOG_URI("  Load from: '%s'", aLoadData->mURI);
 
   nsresult rv = NS_OK;
 
   if (!mDocument && !aLoadData->mIsNonDocumentSheet) {
     // No point starting the load; just release all the data and such.
     LOG_WARN(("  No document and not non-document sheet; pre-dropping load"));
     SheetComplete(aLoadData, NS_BINDING_ABORTED);
@@ -1618,22 +1610,16 @@ nsresult
 Loader::ParseSheet(const nsAString& aInput,
                    SheetLoadData* aLoadData,
                    bool& aCompleted)
 {
   LOG(("css::Loader::ParseSheet"));
   NS_PRECONDITION(aLoadData, "Must have load data");
   NS_PRECONDITION(aLoadData->mSheet, "Must have sheet to parse into");
 
-#ifdef NS_FUNCTION_TIMER
-  nsAutoCString spec__("N/A");
-  if (aLoadData->mURI) aLoadData->mURI->GetSpec(spec__);
-  NS_TIME_FUNCTION_FMT("Parsing stylesheet (url: %s)", spec__.get());
-#endif
-
   aCompleted = false;
 
   nsCSSParser parser(this, aLoadData->mSheet);
 
   // Push our load data on the stack so any kids can pick it up
   mParsingDatas.AppendElement(aLoadData);
   nsIURI* sheetURI = aLoadData->mSheet->GetSheetURI();
   nsIURI* baseURI = aLoadData->mSheet->GetBaseURI();
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -15,17 +15,16 @@
 #include "nsISupportsUtils.h"
 #include "prio.h"
 #include "plstr.h"
 #include "prlog.h"
 #include "stdlib.h"
 #include "nsWildCard.h"
 #include "nsZipArchive.h"
 #include "nsString.h"
-#include "mozilla/FunctionTimer.h"
 #include "prenv.h"
 #if defined(XP_WIN)
 #include <windows.h>
 #endif
 
 // For placement new used for arena allocations of zip file list
 #include NEW_H
 #define ZIP_ARENABLOCKSIZE (1*1024)
@@ -512,19 +511,16 @@ nsZipItem* nsZipArchive::CreateZipItem()
   return (nsZipItem*)mem;
 }
 
 //---------------------------------------------
 //  nsZipArchive::BuildFileList
 //---------------------------------------------
 nsresult nsZipArchive::BuildFileList()
 {
-#ifndef XP_WIN
-  NS_TIME_FUNCTION;
-#endif
   // Get archive size using end pos
   const uint8_t* buf;
   const uint8_t* startp = mFd->mFileData;
   const uint8_t* endp = startp + mFd->mLen;
 MOZ_WIN_MEM_TRY_BEGIN
   uint32_t centralOffset = 4;
   if (mFd->mLen > ZIPCENTRAL_SIZE && xtolong(startp + centralOffset) == CENTRALSIG) {
     // Success means optimized jar layout from bug 559961 is in effect
--- a/netwerk/base/src/nsIOService.cpp
+++ b/netwerk/base/src/nsIOService.cpp
@@ -35,17 +35,16 @@
 #include "nsNetUtil.h"
 #include "nsThreadUtils.h"
 #include "nsIPermissionManager.h"
 #include "nsTArray.h"
 #include "nsIConsoleService.h"
 #include "nsIUploadChannel2.h"
 #include "nsXULAppAPI.h"
 
-#include "mozilla/FunctionTimer.h"
 
 #if defined(XP_WIN) || defined(MOZ_PLATFORM_MAEMO)
 #include "nsNativeConnectionHelper.h"
 #endif
 
 #define PORT_PREF_PREFIX           "network.security.ports."
 #define PORT_PREF(x)               PORT_PREF_PREFIX x
 #define AUTODIAL_PREF              "network.autodial-helper.enabled"
@@ -152,42 +151,36 @@ nsIOService::nsIOService()
     , mContentSniffers(NS_CONTENT_SNIFFER_CATEGORY)
     , mAutoDialEnabled(false)
 {
 }
 
 nsresult
 nsIOService::Init()
 {
-    NS_TIME_FUNCTION;
-
     nsresult rv;
 
     // We need to get references to the DNS service so that we can shut it
     // down later. If we wait until the nsIOService is being shut down,
     // GetService will fail at that point.
 
     mDNSService = do_GetService(NS_DNSSERVICE_CONTRACTID, &rv);
     if (NS_FAILED(rv)) {
         NS_WARNING("failed to get DNS service");
         return rv;
     }
 
-    NS_TIME_FUNCTION_MARK("got DNS Service");
-
     // XXX hack until xpidl supports error info directly (bug 13423)
     nsCOMPtr<nsIErrorService> errorService = do_GetService(NS_ERRORSERVICE_CONTRACTID);
     if (errorService) {
         errorService->RegisterErrorStringBundle(NS_ERROR_MODULE_NETWORK, NECKO_MSGS_URL);
     }
     else
         NS_WARNING("failed to get error service");
     
-    NS_TIME_FUNCTION_MARK("got Error Service");
-
     // setup our bad port list stuff
     for(int i=0; gBadPortList[i]; i++)
         mRestrictedPortList.AppendElement(gBadPortList[i]);
 
     // Further modifications to the port list come from prefs
     nsCOMPtr<nsIPrefBranch> prefBranch;
     GetPrefBranch(getter_AddRefs(prefBranch));
     if (prefBranch) {
@@ -204,39 +197,33 @@ nsIOService::Init()
         observerService->AddObserver(this, kProfileChangeNetTeardownTopic, true);
         observerService->AddObserver(this, kProfileChangeNetRestoreTopic, true);
         observerService->AddObserver(this, kProfileDoChange, true);
         observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, true);
         observerService->AddObserver(this, NS_NETWORK_LINK_TOPIC, true);
     }
     else
         NS_WARNING("failed to get observer service");
-        
-    NS_TIME_FUNCTION_MARK("Registered observers");
 
     gIOService = this;
 
     InitializeNetworkLinkService();
- 
-    NS_TIME_FUNCTION_MARK("Set up network link service");
 
     return NS_OK;
 }
 
 
 nsIOService::~nsIOService()
 {
     gIOService = nullptr;
 }
 
 nsresult
 nsIOService::InitializeSocketTransportService()
 {
-    NS_TIME_FUNCTION;
-
     nsresult rv = NS_OK;
 
     if (!mSocketTransportService) {
         mSocketTransportService = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
         if (NS_FAILED(rv)) {
             NS_WARNING("failed to get socket transport service");
         }
     }
@@ -249,18 +236,16 @@ nsIOService::InitializeSocketTransportSe
     }
 
     return rv;
 }
 
 nsresult
 nsIOService::InitializeNetworkLinkService()
 {
-    NS_TIME_FUNCTION;
-
     nsresult rv = NS_OK;
 
     if (mNetworkLinkServiceInitialized)
         return rv;
 
     if (!NS_IsMainThread()) {
         NS_WARNING("Network link service should be created on main thread"); 
         return NS_ERROR_FAILURE; 
--- a/netwerk/base/src/nsSocketTransportService2.cpp
+++ b/netwerk/base/src/nsSocketTransportService2.cpp
@@ -14,17 +14,16 @@
 #include "prnetdb.h"
 #include "prerror.h"
 #include "plstr.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIOService.h"
 
-#include "mozilla/FunctionTimer.h"
 
 // XXX: There is no good header file to put these in. :(
 namespace mozilla { namespace psm {
 
 void InitializeSSLServerCertVerificationThreads();
 void StopSSLServerCertVerificationThreads();
 
 } } // namespace mozilla::psm
@@ -411,18 +410,16 @@ NS_IMPL_THREADSAFE_ISUPPORTS6(nsSocketTr
                               nsIRunnable,
                               nsPISocketTransportService,
                               nsIObserver)
 
 // called from main thread only
 NS_IMETHODIMP
 nsSocketTransportService::Init()
 {
-    NS_TIME_FUNCTION;
-
     if (!NS_IsMainThread()) {
         NS_ERROR("wrong thread");
         return NS_ERROR_UNEXPECTED;
     }
 
     if (mInitialized)
         return NS_OK;
 
@@ -441,36 +438,32 @@ nsSocketTransportService::Init()
         // event object).  if we can't create a pollable event, then we'll
         // have to "busy wait" to implement the socket event queue :-(
         //
         if (!mThreadEvent) {
             NS_WARNING("running socket transport thread without a pollable event");
             SOCKET_LOG(("running socket transport thread without a pollable event"));
         }
     }
-    
-    NS_TIME_FUNCTION_MARK("Created thread");
 
     nsCOMPtr<nsIThread> thread;
     nsresult rv = NS_NewThread(getter_AddRefs(thread), this);
     if (NS_FAILED(rv)) return rv;
     
     {
         MutexAutoLock lock(mLock);
         // Install our mThread, protecting against concurrent readers
         thread.swap(mThread);
     }
 
     nsCOMPtr<nsIPrefBranch> tmpPrefService = do_GetService(NS_PREFSERVICE_CONTRACTID);
     if (tmpPrefService) 
         tmpPrefService->AddObserver(SEND_BUFFER_PREF, this, false);
     UpdatePrefs();
 
-    NS_TIME_FUNCTION_MARK("UpdatePrefs");
-
     mInitialized = true;
     return NS_OK;
 }
 
 // called from main thread only
 NS_IMETHODIMP
 nsSocketTransportService::Shutdown()
 {
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -32,17 +32,16 @@
 #include "nsProxyRelease.h"
 #include "nsVoidArray.h"
 #include "nsDeleteDir.h"
 #include "nsNetCID.h"
 #include <math.h>  // for log()
 #include "mozilla/Services.h"
 #include "nsITimer.h"
 
-#include "mozilla/FunctionTimer.h"
 
 #include "mozilla/net/NeckoCommon.h"
 
 using namespace mozilla;
 
 /******************************************************************************
  * nsCacheProfilePrefObserver
  *****************************************************************************/
@@ -1104,18 +1103,16 @@ nsCacheService::~nsCacheService()
 
     gService = nullptr;
 }
 
 
 nsresult
 nsCacheService::Init()
 {
-    NS_TIME_FUNCTION;
-
     // Thie method must be called on the main thread because mCacheIOThread must
     // only be modified on the main thread.
     if (!NS_IsMainThread()) {
         NS_ERROR("nsCacheService::Init called off the main thread");
         return NS_ERROR_NOT_SAME_THREAD;
     }
 
     NS_ASSERTION(!mInitialized, "nsCacheService already initialized.");
--- a/netwerk/cache/nsDiskCacheDevice.cpp
+++ b/netwerk/cache/nsDiskCacheDevice.cpp
@@ -39,17 +39,16 @@
 #include "nsICacheVisitor.h"
 #include "nsReadableUtils.h"
 #include "nsIInputStream.h"
 #include "nsIOutputStream.h"
 #include "nsCRT.h"
 #include "nsCOMArray.h"
 #include "nsISimpleEnumerator.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Telemetry.h"
 
 static const char DISK_CACHE_DEVICE_ID[] = { "disk" };
 using namespace mozilla;
 
 class nsDiskCacheDeviceDeactivateEntryEvent : public nsRunnable {
 public:
@@ -381,18 +380,16 @@ nsDiskCacheDevice::~nsDiskCacheDevice()
 
 
 /**
  *  methods of nsCacheDevice
  */
 nsresult
 nsDiskCacheDevice::Init()
 {
-    NS_TIME_FUNCTION;
-
     nsresult rv;
 
     if (Initialized()) {
         NS_ERROR("Disk cache already initialized!");
         return NS_ERROR_UNEXPECTED;
     }
        
     if (!mCacheDirectory)
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
@@ -30,17 +30,16 @@
 #include "mozIStorageService.h"
 #include "mozIStorageStatement.h"
 #include "mozIStorageFunction.h"
 #include "mozStorageHelper.h"
 
 #include "nsICacheVisitor.h"
 #include "nsISeekableStream.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Telemetry.h"
 
 #include "sqlite3.h"
 #include "mozilla/storage.h"
 
 using namespace mozilla;
 using namespace mozilla::storage;
 
@@ -1046,18 +1045,16 @@ struct StatementSql {
     const char *sql;
     StatementSql (nsCOMPtr<mozIStorageStatement> &aStatement, const char *aSql):
       statement (aStatement), sql (aSql) {}
 };
 
 nsresult
 nsOfflineCacheDevice::Init()
 {
-  NS_TIME_FUNCTION;
-
   NS_ENSURE_TRUE(!mDB, NS_ERROR_ALREADY_INITIALIZED);
 
   // SetCacheParentDirectory must have been called
   NS_ENSURE_TRUE(mCacheDirectory, NS_ERROR_UNEXPECTED);
 
   // make sure the cache directory exists
   nsresult rv = EnsureDir(mCacheDirectory);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -41,17 +41,16 @@
 #include "prtime.h"
 #include "prprf.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsIPrivateBrowsingService.h"
 #include "nsNetCID.h"
 #include "mozilla/storage.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Util.h" // for DebugOnly
 #include "mozilla/Attributes.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
 // Create key from baseDomain that will access the default cookie namespace.
 // TODO: When we figure out what the API will look like for nsICookieManager{2}
@@ -603,18 +602,16 @@ nsCookieService::nsCookieService()
  , mMaxCookiesPerHost(kMaxCookiesPerHost)
  , mCookiePurgeAge(kCookiePurgeAge)
 {
 }
 
 nsresult
 nsCookieService::Init()
 {
-  NS_TIME_FUNCTION;
-
   nsresult rv;
   mTLDService = do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mIDNService = do_GetService(NS_IDNSERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mThirdPartyUtil = do_GetService(THIRDPARTYUTIL_CONTRACTID);
--- a/netwerk/dns/nsDNSService2.cpp
+++ b/netwerk/dns/nsDNSService2.cpp
@@ -22,17 +22,16 @@
 #include "prsystem.h"
 #include "prnetdb.h"
 #include "prmon.h"
 #include "prio.h"
 #include "plstr.h"
 #include "nsIOService.h"
 #include "nsCharSeparatedTokenizer.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 static const char kPrefDnsCacheEntries[]    = "network.dnsCacheEntries";
 static const char kPrefDnsCacheExpiration[] = "network.dnsCacheExpiration";
 static const char kPrefDnsCacheGrace[]      = "network.dnsCacheExpirationGracePeriod";
 static const char kPrefEnableIDN[]          = "network.enableIDN";
@@ -359,18 +358,16 @@ nsDNSService::~nsDNSService()
 }
 
 NS_IMPL_THREADSAFE_ISUPPORTS3(nsDNSService, nsIDNSService, nsPIDNSService,
                               nsIObserver)
 
 NS_IMETHODIMP
 nsDNSService::Init()
 {
-    NS_TIME_FUNCTION;
-
     if (mResolver)
         return NS_OK;
     NS_ENSURE_TRUE(!mResolver, NS_ERROR_ALREADY_INITIALIZED);
 
     // prefs
     uint32_t maxCacheEntries  = 400;
     uint32_t maxCacheLifetime = 2; // minutes
     uint32_t lifetimeGracePeriod = 1;
--- a/netwerk/dns/nsEffectiveTLDService.cpp
+++ b/netwerk/dns/nsEffectiveTLDService.cpp
@@ -9,17 +9,16 @@
 
 #include "mozilla/Util.h"
 
 #include "nsEffectiveTLDService.h"
 #include "nsIIDNService.h"
 #include "nsNetUtil.h"
 #include "prnetdb.h"
 
-#include "mozilla/FunctionTimer.h"
 
 using namespace mozilla;
 
 NS_IMPL_ISUPPORTS1(nsEffectiveTLDService, nsIEffectiveTLDService)
 
 // ----------------------------------------------------------------------
 
 #define ETLD_STR_NUM_1(line) str##line
@@ -56,18 +55,16 @@ nsDomainEntry::FuncForStaticAsserts(void
 #undef ETLD_STR_NUM
 #undef ETLD_STR_NUM1
 
 // ----------------------------------------------------------------------
 
 nsresult
 nsEffectiveTLDService::Init()
 {
-  NS_TIME_FUNCTION;
-
   const ETLDEntry *entries = nsDomainEntry::entries;
 
   // We'll probably have to rehash at least once, since nsTHashtable doesn't
   // use a perfect hash, but at least we'll save a few rehashes along the way.
   // Next optimization here is to precompute the hash using something like
   // gperf, but one step at a time.  :-)
   mHash.Init(ArrayLength(nsDomainEntry::entries));
 
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -29,17 +29,16 @@
 #include "prlong.h"
 #include "prlog.h"
 #include "pldhash.h"
 #include "plstr.h"
 #include "nsURLHelper.h"
 #include "nsThreadUtils.h"
 
 #include "mozilla/HashFunctions.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Telemetry.h"
 
 using namespace mozilla;
 
 //----------------------------------------------------------------------------
 
 // Use a persistent thread pool in order to avoid spinning up new threads all the time.
@@ -362,18 +361,16 @@ nsHostResolver::nsHostResolver(uint32_t 
 nsHostResolver::~nsHostResolver()
 {
     PL_DHashTableFinish(&mDB);
 }
 
 nsresult
 nsHostResolver::Init()
 {
-    NS_TIME_FUNCTION;
-
     PL_DHashTableInit(&mDB, &gHostDB_ops, nullptr, sizeof(nsHostDBEnt), 0);
 
     mShutdown = false;
 
 #if defined(HAVE_RES_NINIT)
     // We want to make sure the system is using the correct resolver settings,
     // so we force it to reload those settings whenever we startup a subsequent
     // nsHostResolver instance.  We assume that there is no reason to do this
--- a/netwerk/dns/nsIDNService.cpp
+++ b/netwerk/dns/nsIDNService.cpp
@@ -9,17 +9,16 @@
 #include "nsUnicharUtils.h"
 #include "nsIServiceManager.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIObserverService.h"
 #include "nsISupportsPrimitives.h"
 #include "punycode.h"
 
-#include "mozilla/FunctionTimer.h"
 
 //-----------------------------------------------------------------------------
 // RFC 1034 - 3.1. Name space specifications and terminology
 static const uint32_t kMaxDNSNodeLen = 63;
 
 //-----------------------------------------------------------------------------
 
 #define NS_NET_PREF_IDNTESTBED      "network.IDN_testbed"
@@ -42,18 +41,16 @@ inline bool isOnlySafeChars(const nsAFla
 /* Implementation file */
 NS_IMPL_THREADSAFE_ISUPPORTS3(nsIDNService,
                               nsIIDNService,
                               nsIObserver,
                               nsISupportsWeakReference)
 
 nsresult nsIDNService::Init()
 {
-  NS_TIME_FUNCTION;
-
   nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
   if (prefs)
     prefs->GetBranch(NS_NET_PREF_IDNWHITELIST, getter_AddRefs(mIDNWhitelistPrefBranch));
 
   nsCOMPtr<nsIPrefBranch> prefInternal(do_QueryInterface(prefs));
   if (prefInternal) {
     prefInternal->AddObserver(NS_NET_PREF_IDNTESTBED, this, true); 
     prefInternal->AddObserver(NS_NET_PREF_IDNPREFIX, this, true); 
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -58,17 +58,16 @@
 #include <os2.h>
 #endif
 
 //-----------------------------------------------------------------------------
 using namespace mozilla;
 using namespace mozilla::net;
 #include "mozilla/net/HttpChannelChild.h"
 
-#include "mozilla/FunctionTimer.h"
 
 #ifdef DEBUG
 // defined by the socket transport service while active
 extern PRThread *gSocketThread;
 #endif
 
 static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
 static NS_DEFINE_CID(kStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID);
@@ -203,18 +202,16 @@ nsHttpHandler::~nsHttpHandler()
     nsHttp::DestroyAtomTable();
 
     gHttpHandler = nullptr;
 }
 
 nsresult
 nsHttpHandler::Init()
 {
-    NS_TIME_FUNCTION;
-
     nsresult rv;
 
     LOG(("nsHttpHandler::Init\n"));
 
     rv = nsHttp::CreateAtomTable();
     if (NS_FAILED(rv))
         return rv;
 
@@ -305,18 +302,16 @@ nsHttpHandler::Init()
     }
 
     return NS_OK;
 }
 
 nsresult
 nsHttpHandler::InitConnectionMgr()
 {
-    NS_TIME_FUNCTION;
-
     nsresult rv;
 
     if (!mConnMgr) {
         mConnMgr = new nsHttpConnectionMgr();
         if (!mConnMgr)
             return NS_ERROR_OUT_OF_MEMORY;
         NS_ADDREF(mConnMgr);
     }
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -23,17 +23,16 @@
 #include "nsISocketTransport.h"
 #include "nsMultiplexInputStream.h"
 #include "nsStringStream.h"
 
 #include "nsComponentManagerUtils.h" // do_CreateInstance
 #include "nsServiceManagerUtils.h"   // do_GetService
 #include "nsIHttpActivityObserver.h"
 
-#include "mozilla/FunctionTimer.h"
 
 using namespace mozilla;
 
 //-----------------------------------------------------------------------------
 
 #ifdef DEBUG
 // defined by the socket transport service while active
 extern PRThread *gSocketThread;
@@ -168,18 +167,16 @@ nsHttpTransaction::Init(uint8_t caps,
                         nsHttpRequestHead *requestHead,
                         nsIInputStream *requestBody,
                         bool requestBodyHasHeaders,
                         nsIEventTarget *target,
                         nsIInterfaceRequestor *callbacks,
                         nsITransportEventSink *eventsink,
                         nsIAsyncInputStream **responseBody)
 {
-    NS_TIME_FUNCTION;
-
     nsresult rv;
 
     LOG(("nsHttpTransaction::Init [this=%x caps=%x]\n", this, caps));
 
     NS_ASSERTION(cinfo, "ouch");
     NS_ASSERTION(requestHead, "ouch");
     NS_ASSERTION(target, "ouch");
 
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -26,17 +26,16 @@
 #include "nsISupports.h"
 #include "nsITimer.h"
 #include "nsIZipWriter.h"
 #include "nsIZipReader.h"
 #include "nsWeakReference.h"
 #include "nsZipArchive.h"
 #include "mozilla/Omnijar.h"
 #include "prenv.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Telemetry.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 #include "nsIProtocolHandler.h"
 
 #ifdef IS_BIG_ENDIAN
 #define SC_ENDIAN "big"
 #else
@@ -480,17 +479,16 @@ StartupCache::InvalidateCache()
  */
 void
 StartupCache::WaitOnWriteThread()
 {
   NS_ASSERTION(NS_IsMainThread(), "Startup cache should only wait for io thread on main thread");
   if (!mWriteThread || mWriteThread == PR_GetCurrentThread())
     return;
 
-  NS_TIME_FUNCTION_MIN(30);
   PR_JoinThread(mWriteThread);
   mWriteThread = NULL;
 }
 
 void 
 StartupCache::ThreadedWrite(void *aClosure)
 {
   PR_SetCurrentThreadName("StartupCache");
--- a/storage/src/mozStorageService.cpp
+++ b/storage/src/mozStorageService.cpp
@@ -28,17 +28,16 @@
 #ifdef SQLITE_OS_WIN
 // "windows.h" was included and it can #define lots of things we care about...
 #undef CompareString
 #endif
 
 #include "nsIPromptService.h"
 #include "nsIMemoryReporter.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Util.h"
 
 namespace {
 
 class QuotaCallbackData
 {
 public:
   QuotaCallbackData(mozIStorageQuotaCallback *aCallback,
@@ -566,18 +565,16 @@ const sqlite3_mem_methods memMethods = {
 
 } // anonymous namespace
 
 #endif  // MOZ_STORAGE_MEMORY
 
 nsresult
 Service::initialize()
 {
-  NS_TIME_FUNCTION;
-
   int rc;
 
 #ifdef MOZ_STORAGE_MEMORY
   rc = ::sqlite3_config(SQLITE_CONFIG_MALLOC, &memMethods);
   if (rc != SQLITE_OK)
     return convertResultCode(rc);
 #endif
 
@@ -724,22 +721,16 @@ Service::OpenSpecialDatabase(const char 
 }
 
 NS_IMETHODIMP
 Service::OpenDatabase(nsIFile *aDatabaseFile,
                       mozIStorageConnection **_connection)
 {
   NS_ENSURE_ARG(aDatabaseFile);
 
-#ifdef NS_FUNCTION_TIMER
-  nsCString leafname;
-  (void)aDatabaseFile->GetNativeLeafName(leafname);
-  NS_TIME_FUNCTION_FMT("mozIStorageService::OpenDatabase(%s)", leafname.get());
-#endif
-
   // Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility
   // reasons.
   int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_SHAREDCACHE |
               SQLITE_OPEN_CREATE;
   nsRefPtr<Connection> msc = new Connection(this, flags);
   NS_ENSURE_TRUE(msc, NS_ERROR_OUT_OF_MEMORY);
 
   nsresult rv = msc->initialize(aDatabaseFile);
@@ -750,23 +741,16 @@ Service::OpenDatabase(nsIFile *aDatabase
 }
 
 NS_IMETHODIMP
 Service::OpenUnsharedDatabase(nsIFile *aDatabaseFile,
                               mozIStorageConnection **_connection)
 {
   NS_ENSURE_ARG(aDatabaseFile);
 
-#ifdef NS_FUNCTION_TIMER
-  nsCString leafname;
-  (void)aDatabaseFile->GetNativeLeafName(leafname);
-  NS_TIME_FUNCTION_FMT("mozIStorageService::OpenUnsharedDatabase(%s)",
-                       leafname.get());
-#endif
-
   // Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility
   // reasons.
   int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_PRIVATECACHE |
               SQLITE_OPEN_CREATE;
   nsRefPtr<Connection> msc = new Connection(this, flags);
   NS_ENSURE_TRUE(msc, NS_ERROR_OUT_OF_MEMORY);
 
   nsresult rv = msc->initialize(aDatabaseFile);
@@ -863,23 +847,16 @@ Service::Observe(nsISupports *, const ch
 
 NS_IMETHODIMP
 Service::OpenDatabaseWithVFS(nsIFile *aDatabaseFile,
                              const nsACString &aVFSName,
                              mozIStorageConnection **_connection)
 {
   NS_ENSURE_ARG(aDatabaseFile);
 
-#ifdef NS_FUNCTION_TIMER
-  nsCString leafname;
-  (void)aDatabaseFile->GetNativeLeafName(leafname);
-  NS_TIME_FUNCTION_FMT("mozIStorageService::OpenDatabaseWithVFS(%s)",
-                       leafname.get());
-#endif
-
   // Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility
   // reasons.
   int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_SHAREDCACHE |
               SQLITE_OPEN_CREATE;
   nsRefPtr<Connection> msc = new Connection(this, flags);
   NS_ENSURE_TRUE(msc, NS_ERROR_OUT_OF_MEMORY);
 
   nsresult rv = msc->initialize(aDatabaseFile,
--- a/storage/src/mozStorageStatement.cpp
+++ b/storage/src/mozStorageStatement.cpp
@@ -22,17 +22,16 @@
 #include "mozStoragePrivateHelpers.h"
 #include "mozStorageStatementParams.h"
 #include "mozStorageStatementRow.h"
 #include "mozStorageStatement.h"
 #include "sampler.h"
 
 #include "prlog.h"
 
-#include "mozilla/FunctionTimer.h"
 
 #ifdef PR_LOGGING
 extern PRLogModuleInfo* gStorageLog;
 #endif
 
 namespace mozilla {
 namespace storage {
 
@@ -552,19 +551,16 @@ Statement::Execute()
 
 NS_IMETHODIMP
 Statement::ExecuteStep(bool *_moreResults)
 {
   SAMPLE_LABEL("storage", "Statement::ExecuteStep");
   if (!mDBStatement)
     return NS_ERROR_NOT_INITIALIZED;
 
-  NS_TIME_FUNCTION_MIN_FMT(5, "mozIStorageStatement::ExecuteStep(%s) (0x%p)",
-                           mDBConnection->getFilename().get(), mDBStatement);
-
   // Bind any parameters first before executing.
   if (mParamsArray) {
     // If we have more than one row of parameters to bind, they shouldn't be
     // calling this method (and instead use executeAsync).
     if (mParamsArray->length() != 1)
       return NS_ERROR_UNEXPECTED;
 
     BindingParamsArray::iterator row = mParamsArray->begin();
--- a/toolkit/components/places/nsNavBookmarks.cpp
+++ b/toolkit/components/places/nsNavBookmarks.cpp
@@ -11,17 +11,16 @@
 #include "Helpers.h"
 
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsNetUtil.h"
 #include "nsUnicharUtils.h"
 #include "nsPrintfCString.h"
 #include "prprf.h"
 #include "mozilla/storage.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Util.h"
 
 #include "sampler.h"
 
 #define BOOKMARKS_TO_KEYWORDS_INITIAL_CACHE_SIZE 64
 #define RECENT_BOOKMARKS_INITIAL_CACHE_SIZE 10
 // Threashold to expire old bookmarks if the initial cache size is exceeded.
 #define RECENT_BOOKMARKS_THRESHOLD PRTime((int64_t)1 * 60 * PR_USEC_PER_SEC)
@@ -232,18 +231,16 @@ NS_IMPL_ISUPPORTS5(nsNavBookmarks
 , nsIObserver
 , nsISupportsWeakReference
 )
 
 
 nsresult
 nsNavBookmarks::Init()
 {
-  NS_TIME_FUNCTION;
-
   mDB = Database::GetDatabase();
   NS_ENSURE_STATE(mDB);
 
   mRecentBookmarksCache.Init(RECENT_BOOKMARKS_INITIAL_CACHE_SIZE);
   mUncachableBookmarks.Init(RECENT_BOOKMARKS_INITIAL_CACHE_SIZE);
 
   nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
   if (os) {
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -27,17 +27,16 @@
 #include "prtime.h"
 #include "nsEscape.h"
 #include "nsIEffectiveTLDService.h"
 #include "nsIClassInfoImpl.h"
 #include "nsThreadUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsMathUtils.h"
 #include "mozilla/storage.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Util.h"
 #include "mozilla/Preferences.h"
 
 #ifdef MOZ_XUL
 #include "nsIAutoCompleteInput.h"
 #include "nsIAutoCompletePopup.h"
 #endif
 
@@ -285,18 +284,16 @@ nsNavHistory::~nsNavHistory()
   if (gHistoryService == this)
     gHistoryService = nullptr;
 }
 
 
 nsresult
 nsNavHistory::Init()
 {
-  NS_TIME_FUNCTION;
-
   LoadPrefs();
 
   mDB = Database::GetDatabase();
   NS_ENSURE_STATE(mDB);
 
   // recent events hash tables
   mRecentTyped.Init(RECENT_EVENTS_INITIAL_CACHE_SIZE);
   mRecentLink.Init(RECENT_EVENTS_INITIAL_CACHE_SIZE);
--- a/toolkit/components/startup/nsAppStartup.cpp
+++ b/toolkit/components/startup/nsAppStartup.cpp
@@ -29,17 +29,16 @@
 
 #include "prprf.h"
 #include "nsCRT.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsWidgetsCID.h"
 #include "nsAppShellCID.h"
 #include "nsXPCOMCIDInternal.h"
 #include "mozilla/Services.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsIXPConnect.h"
 #include "jsapi.h"
 #include "prenv.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "mozilla/mozPoisonWrite.h"
 
 #if defined(XP_WIN)
 #include <windows.h>
@@ -167,32 +166,27 @@ nsAppStartup::nsAppStartup() :
   mCachedShutdownTime(false),
   mLastShutdownTime(0)
 { }
 
 
 nsresult
 nsAppStartup::Init()
 {
-  NS_TIME_FUNCTION;
   nsresult rv;
 
   // Create widget application shell
   mAppShell = do_GetService(kAppShellCID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  NS_TIME_FUNCTION_MARK("Got AppShell service");
-
   nsCOMPtr<nsIObserverService> os =
     mozilla::services::GetObserverService();
   if (!os)
     return NS_ERROR_FAILURE;
 
-  NS_TIME_FUNCTION_MARK("Got Observer service");
-
   os->AddObserver(this, "quit-application-forced", true);
   os->AddObserver(this, "sessionstore-windows-restored", true);
   os->AddObserver(this, "profile-change-teardown", true);
   os->AddObserver(this, "xul-window-registered", true);
   os->AddObserver(this, "xul-window-destroyed", true);
 
 #if defined(XP_WIN)
   os->AddObserver(this, "xpcom-shutdown", true);
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -86,17 +86,16 @@
 #include "nsIXULAppInfo.h"
 #include "nsIXULRuntime.h"
 #include "nsPIDOMWindow.h"
 #include "nsIBaseWindow.h"
 #include "nsIWidget.h"
 #include "nsIDocShell.h"
 #include "nsAppShellCID.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/unused.h"
 
 using namespace mozilla;
 using mozilla::unused;
 
 #ifdef XP_WIN
 #include "nsIWinAppHelper.h"
 #include <windows.h>
@@ -179,17 +178,16 @@ using mozilla::unused;
 #include "nsExceptionHandler.h"
 #include "nsICrashReporter.h"
 #define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1"
 #include "nsIPrefService.h"
 #endif
 
 #include "base/command_line.h"
 
-#include "mozilla/FunctionTimer.h"
 
 #ifdef MOZ_WIDGET_ANDROID
 #include "AndroidBridge.h"
 #endif
 
 extern uint32_t gRestartMode;
 extern void InstallSignalHandlers(const char *ProgramName);
 #include "nsX11ErrorHandler.h"
@@ -1227,41 +1225,33 @@ nsSingletonFactory::LockFactory(bool)
 }
 
 /**
  * Set our windowcreator on the WindowWatcher service.
  */
 nsresult
 ScopedXPCOMStartup::SetWindowCreator(nsINativeAppSupport* native)
 {
-  NS_TIME_FUNCTION;
   nsresult rv;
 
   NS_IF_ADDREF(gNativeAppSupport = native);
 
   // Inform the chrome registry about OS accessibility
   nsCOMPtr<nsIToolkitChromeRegistry> cr =
     mozilla::services::GetToolkitChromeRegistryService();
-  NS_TIME_FUNCTION_MARK("Got ToolkitChromeRegistry service");
 
   if (cr)
     cr->CheckForOSAccessibility();
 
-  NS_TIME_FUNCTION_MARK("OS Accessibility check");
-
   nsCOMPtr<nsIWindowCreator> creator (do_GetService(NS_APPSTARTUP_CONTRACTID));
   if (!creator) return NS_ERROR_UNEXPECTED;
 
-  NS_TIME_FUNCTION_MARK("Got AppStartup service");
-
   nsCOMPtr<nsIWindowWatcher> wwatch
     (do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
-  
-  NS_TIME_FUNCTION_MARK("Got WindowWatcher service");
 
   return wwatch->SetWindowCreator(creator);
 }
 
 /* static */ nsresult
 ScopedXPCOMStartup::CreateAppSupport(nsISupports* aOuter, REFNSIID aIID, void** aResult)
 {
   if (aOuter)
@@ -2793,18 +2783,16 @@ public:
 /*
  * XRE_mainInit - Initial setup and command line parameter processing.
  * Main() will exit early if either return value != 0 or if aExitFlag is
  * true.
  */
 int
 XREMain::XRE_mainInit(const nsXREAppData* aAppData, bool* aExitFlag)
 {
-  NS_TIME_FUNCTION;
-
   if (!aExitFlag)
     return 1;
   *aExitFlag = false;
 
   StartupTimeline::Record(StartupTimeline::MAIN);
 
   nsresult rv;
   ArgResult ar;
@@ -3188,17 +3176,16 @@ XREMain::XRE_mainInit(const nsXREAppData
 /*
  * XRE_mainStartup - Initializes the profile and various other services.
  * Main() will exit early if either return value != 0 or if aExitFlag is
  * true.
  */
 int
 XREMain::XRE_mainStartup(bool* aExitFlag)
 {
-  NS_TIME_FUNCTION;
   nsresult rv;
 
   if (!aExitFlag)
     return 1;
   *aExitFlag = false;
 
 #if defined(MOZ_WIDGET_GTK) || defined(MOZ_ENABLE_XREMOTE)
   // Stash DESKTOP_STARTUP_ID in malloc'ed memory because gtk_init will clear it.
@@ -3565,52 +3552,42 @@ XREMain::XRE_mainStartup(bool* aExitFlag
 
 /*
  * XRE_mainRun - Command line startup, profile migration, and
  * the calling of appStartup->Run().
  */
 nsresult
 XREMain::XRE_mainRun()
 {
-  NS_TIME_FUNCTION;
   nsresult rv = NS_OK;
   NS_ASSERTION(mScopedXPCom, "Scoped xpcom not initialized.");
 
 #ifdef NS_FUNCTION_TIMER
   // initialize some common services, so we don't pay the cost for these at odd times later on;
   // SetWindowCreator -> ChromeRegistry -> IOService -> SocketTransportService -> (nspr wspm init), Prefs
   {
     nsCOMPtr<nsISupports> comp;
 
     comp = do_GetService("@mozilla.org/preferences-service;1");
-    NS_TIME_FUNCTION_MARK("Pref Service");
 
     comp = do_GetService("@mozilla.org/network/socket-transport-service;1");
-    NS_TIME_FUNCTION_MARK("Socket Transport Service");
 
     comp = do_GetService("@mozilla.org/network/dns-service;1");
-    NS_TIME_FUNCTION_MARK("DNS Service");
 
     comp = do_GetService("@mozilla.org/network/io-service;1");
-    NS_TIME_FUNCTION_MARK("IO Service");
 
     comp = do_GetService("@mozilla.org/chrome/chrome-registry;1");
-    NS_TIME_FUNCTION_MARK("Chrome Registry Service");
 
     comp = do_GetService("@mozilla.org/focus-event-suppressor-service;1");
-    NS_TIME_FUNCTION_MARK("Focus Event Suppressor Service");
   }
 #endif
 
   rv = mScopedXPCom->SetWindowCreator(mNativeApp);
-  NS_TIME_FUNCTION_MARK("ScopedXPCOMStartup: SetWindowCreator");
   NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
-  NS_TIME_FUNCTION_MARK("ScopedXPCOMStartup: Done");
-
 #ifdef MOZ_CRASHREPORTER
   // tell the crash reporter to also send the release channel
   nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
   if (NS_SUCCEEDED(rv)) {
     nsCOMPtr<nsIPrefBranch> defaultPrefBranch;
     rv = prefs->GetDefaultBranch(nullptr, getter_AddRefs(defaultPrefBranch));
 
     if (NS_SUCCEEDED(rv)) {
@@ -3619,41 +3596,35 @@ XREMain::XRE_mainRun()
       if (NS_SUCCEEDED(rv)) {
         CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ReleaseChannel"),
                                             sval);
       }
     }
   }
 #endif
 
-  NS_TIME_FUNCTION_MARK("Next: AppStartup");
-
   if (mStartOffline) {
     nsCOMPtr<nsIIOService2> io (do_GetService("@mozilla.org/network/io-service;1"));
     NS_ENSURE_TRUE(io, NS_ERROR_FAILURE);
     io->SetManageOfflineStatus(false);
     io->SetOffline(true);
   }
 
   {
     nsCOMPtr<nsIObserver> startupNotifier
       (do_CreateInstance(NS_APPSTARTUPNOTIFIER_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
     startupNotifier->Observe(nullptr, APPSTARTUP_TOPIC, nullptr);
   }
 
-  NS_TIME_FUNCTION_MARK("Finished startupNotifier");
-
   nsCOMPtr<nsIAppStartup> appStartup
     (do_GetService(NS_APPSTARTUP_CONTRACTID));
   NS_ENSURE_TRUE(appStartup, NS_ERROR_FAILURE);
 
-  NS_TIME_FUNCTION_MARK("Created AppStartup");
-
   if (gDoMigration) {
     nsCOMPtr<nsIFile> file;
     mDirProvider.GetAppDir()->Clone(getter_AddRefs(file));
     file->AppendNative(NS_LITERAL_CSTRING("override.ini"));
     nsINIParser parser;
     nsresult rv = parser.Init(file);
     if (NS_SUCCEEDED(rv)) {
       nsAutoCString buf;
@@ -3697,22 +3668,18 @@ XREMain::XRE_mainRun()
       if (NS_FAILED(backupCreated)) NS_WARNING("Could not cleanup the profile that was reset");
 
       // Set the new profile as the default after we're done cleaning up the old default.
       rv = SetCurrentProfileAsDefault(mProfileSvc, mProfD);
       if (NS_FAILED(rv)) NS_WARNING("Could not set current profile as the default");
     }
   }
 
-  NS_TIME_FUNCTION_MARK("Profile migration");
-
   mDirProvider.DoStartup();
 
-  NS_TIME_FUNCTION_MARK("dirProvider.DoStartup() (profile-after-change)");
-
   appStartup->GetShuttingDown(&mShuttingDown);
 
   nsCOMPtr<nsICommandLineRunner> cmdLine;
 
   nsCOMPtr<nsIFile> workingDir;
   rv = NS_GetSpecialDirectory(NS_OS_CURRENT_WORKING_DIR, getter_AddRefs(workingDir));
   NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
@@ -3726,39 +3693,31 @@ XREMain::XRE_mainRun()
 
     /* Special-case services that need early access to the command
         line. */
     nsCOMPtr<nsIObserverService> obsService =
       mozilla::services::GetObserverService();
     if (obsService) {
       obsService->NotifyObservers(cmdLine, "command-line-startup", nullptr);
     }
-
-    NS_TIME_FUNCTION_MARK("Early command line init");
-
-    NS_TIME_FUNCTION_MARK("Next: prepare for Run");
   }
 
   SaveStateForAppInitiatedRestart();
 
   // clear out any environment variables which may have been set 
   // during the relaunch process now that we know we won't be relaunching.
   SaveToEnv("XRE_PROFILE_PATH=");
   SaveToEnv("XRE_PROFILE_LOCAL_PATH=");
   SaveToEnv("XRE_PROFILE_NAME=");
   SaveToEnv("XRE_START_OFFLINE=");
   SaveToEnv("NO_EM_RESTART=");
   SaveToEnv("XUL_APP_FILE=");
   SaveToEnv("XRE_BINARY_PATH=");
 
-  NS_TIME_FUNCTION_MARK("env munging");
-
   if (!mShuttingDown) {
-    NS_TIME_FUNCTION_MARK("Next: CreateHiddenWindow");
-
     rv = appStartup->CreateHiddenWindow();
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
 #if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK)
     nsGTKToolkit* toolkit = nsGTKToolkit::GetToolkit();
     if (toolkit && !mDesktopStartupID.IsEmpty()) {
       toolkit->SetDesktopStartupID(mDesktopStartupID);
     }
@@ -3784,18 +3743,16 @@ XREMain::XRE_mainRun()
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 #endif
 
     nsCOMPtr<nsIObserverService> obsService =
       mozilla::services::GetObserverService();
     if (obsService)
       obsService->NotifyObservers(nullptr, "final-ui-startup", nullptr);
 
-    NS_TIME_FUNCTION_MARK("final-ui-startup done");
-
     appStartup->GetShuttingDown(&mShuttingDown);
   }
 
   if (!mShuttingDown) {
     rv = cmdLine->Run();
     NS_ENSURE_SUCCESS_LOG(rv, NS_ERROR_FAILURE);
 
     appStartup->GetShuttingDown(&mShuttingDown);
@@ -3816,49 +3773,38 @@ XREMain::XRE_mainRun()
   }
 
 #ifdef MOZ_INSTRUMENT_EVENT_LOOP
   if (PR_GetEnv("MOZ_INSTRUMENT_EVENT_LOOP") || SAMPLER_IS_ACTIVE()) {
     mozilla::InitEventTracing();
   }
 #endif /* MOZ_INSTRUMENT_EVENT_LOOP */
 
-  NS_TIME_FUNCTION_MARK("Next: Run");
-
-  NS_TIME_FUNCTION_MARK("appStartup->Run");
-
   {
     rv = appStartup->Run();
     if (NS_FAILED(rv)) {
       NS_ERROR("failed to run appstartup");
       gLogConsoleErrors = true;
     }
   }
 
-  NS_TIME_FUNCTION_MARK("Next: Finish");
-
-  NS_TIME_FUNCTION_MARK("appStartup->Run done");
-
   return rv;
 }
 
 /*
  * XRE_main - A class based main entry point used by most platforms.
  */
 int
 XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
 {
-  NS_TIME_FUNCTION;
   SAMPLER_INIT();
   SAMPLE_LABEL("Startup", "XRE_Main");
 
   nsresult rv = NS_OK;
 
-  NS_TIME_FUNCTION_MARK("XRE_main init");
-
   gArgc = argc;
   gArgv = argv;
 
   NS_ENSURE_TRUE(aAppData, 2);
 
   mAppData = new ScopedAppData(aAppData);
   if (!mAppData)
     return 1;
@@ -3878,39 +3824,34 @@ XREMain::XRE_main(int argc, char* argv[]
 #endif
 
   // init
   bool exit = false;
   int result = XRE_mainInit(aAppData, &exit);
   if (result != 0 || exit)
     return result;
 
-  NS_TIME_FUNCTION_MARK("XRE_main startup");
   // startup
   result = XRE_mainStartup(&exit);
   if (result != 0 || exit)
     return result;
 
   bool appInitiatedRestart = false;
 
   // Start the real application
-  NS_TIME_FUNCTION_MARK("XRE_main ScopedXPCOMStartup");
   mScopedXPCom = new ScopedXPCOMStartup();
   if (!mScopedXPCom)
     return 1;
 
-  NS_TIME_FUNCTION_MARK("ScopedXPCOMStartup: Initialize");
   rv = mScopedXPCom->Initialize();
   NS_ENSURE_SUCCESS(rv, 1);
 
   // run!
-  NS_TIME_FUNCTION_MARK("XRE_main run");
   rv = XRE_mainRun();
 
-  NS_TIME_FUNCTION_MARK("XRE_main shutdown");
 #ifdef MOZ_INSTRUMENT_EVENT_LOOP
   mozilla::ShutdownEventTracing();
 #endif
 
   // Check for an application initiated restart.  This is one that
   // corresponds to nsIAppStartup.quit(eRestart)
   if (rv == NS_SUCCESS_RESTART_APP) {
     appInitiatedRestart = true;
--- a/uriloader/base/nsURILoader.cpp
+++ b/uriloader/base/nsURILoader.cpp
@@ -43,29 +43,16 @@
 #include "nsIMIMEHeaderParam.h"
 #include "nsNetCID.h"
 
 #include "nsMimeTypes.h"
 
 #include "nsDocLoader.h"
 #include "mozilla/Attributes.h"
 
-#include "mozilla/FunctionTimer.h"
-#ifdef NS_FUNCTION_TIMER
-#define TIME_URILOADER_FUNCTION(req)                         \
-    nsAutoCString name__("N/A");                             \
-    (req)->GetName(name__);                                  \
-    NS_TIME_FUNCTION_FMT("%s (line %d) (request: %s)",       \
-                         MOZ_FUNCTION_NAME,                  \
-                         __LINE__,                           \
-                         name__.get())
-#else
-#define TIME_URILOADER_FUNCTION(req) do {} while(0)
-#endif
-
 #ifdef PR_LOGGING
 PRLogModuleInfo* nsURILoader::mLog = nullptr;
 #endif
 
 #define LOG(args) PR_LOG(nsURILoader::mLog, PR_LOG_DEBUG, args)
 #define LOG_ERROR(args) PR_LOG(nsURILoader::mLog, PR_LOG_ERROR, args)
 #define LOG_ENABLED() PR_LOG_TEST(nsURILoader::mLog, PR_LOG_DEBUG)
 
@@ -200,18 +187,16 @@ nsresult nsDocumentOpenInfo::Prepare()
 
   // ask our window context if it has a uri content listener...
   m_contentListener = do_GetInterface(m_originalContext, &rv);
   return rv;
 }
 
 NS_IMETHODIMP nsDocumentOpenInfo::OnStartRequest(nsIRequest *request, nsISupports * aCtxt)
 {
-  TIME_URILOADER_FUNCTION(request);
-
   LOG(("[0x%p] nsDocumentOpenInfo::OnStartRequest", this));
   
   nsresult rv = NS_OK;
 
   //
   // Deal with "special" HTTP responses:
   // 
   // - In the case of a 204 (No Content) or 205 (Reset Content) response, do
@@ -277,33 +262,29 @@ NS_IMETHODIMP nsDocumentOpenInfo::OnStar
   return rv;
 }
 
 NS_IMETHODIMP
 nsDocumentOpenInfo::OnDataAvailable(nsIRequest *request, nsISupports * aCtxt,
                                     nsIInputStream * inStr,
                                     uint64_t sourceOffset, uint32_t count)
 {
-  TIME_URILOADER_FUNCTION(request);
-
   // if we have retarged to the end stream listener, then forward the call....
   // otherwise, don't do anything
 
   nsresult rv = NS_OK;
   
   if (m_targetStreamListener)
     rv = m_targetStreamListener->OnDataAvailable(request, aCtxt, inStr, sourceOffset, count);
   return rv;
 }
 
 NS_IMETHODIMP nsDocumentOpenInfo::OnStopRequest(nsIRequest *request, nsISupports *aCtxt, 
                                                 nsresult aStatus)
 {
-  TIME_URILOADER_FUNCTION(request);
-
   LOG(("[0x%p] nsDocumentOpenInfo::OnStopRequest", this));
   
   if ( m_targetStreamListener)
   {
     nsCOMPtr<nsIStreamListener> listener(m_targetStreamListener);
 
     // If this is a multipart stream, we could get another
     // OnStartRequest after this... reset state.
@@ -316,18 +297,16 @@ NS_IMETHODIMP nsDocumentOpenInfo::OnStop
   // In the case of multiplexed streams (such as multipart/x-mixed-replace)
   // these stream listener methods could be called again :-)
   //
   return NS_OK;
 }
 
 nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports * aCtxt)
 {
-  TIME_URILOADER_FUNCTION(request);
-
   LOG(("[0x%p] nsDocumentOpenInfo::DispatchContent for type '%s'", this, mContentType.get()));
 
   NS_PRECONDITION(!m_targetStreamListener,
                   "Why do we already have a target stream listener?");
   
   nsresult rv;
   nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(request);
   if (!aChannel) {
@@ -548,18 +527,16 @@ nsresult nsDocumentOpenInfo::DispatchCon
 }
 
 nsresult
 nsDocumentOpenInfo::ConvertData(nsIRequest *request,
                                 nsIURIContentListener* aListener,
                                 const nsACString& aSrcContentType,
                                 const nsACString& aOutContentType)
 {
-  TIME_URILOADER_FUNCTION(request);
-
   LOG(("[0x%p] nsDocumentOpenInfo::ConvertData from '%s' to '%s'", this,
        PromiseFlatCString(aSrcContentType).get(),
        PromiseFlatCString(aOutContentType).get()));
 
   NS_PRECONDITION(aSrcContentType != aOutContentType,
                   "ConvertData called when the two types are the same!");
   nsresult rv = NS_OK;
 
@@ -606,18 +583,16 @@ nsDocumentOpenInfo::ConvertData(nsIReque
                                              request,
                                              getter_AddRefs(m_targetStreamListener));
 }
 
 bool
 nsDocumentOpenInfo::TryContentListener(nsIURIContentListener* aListener,
                                        nsIChannel* aChannel)
 {
-  TIME_URILOADER_FUNCTION(aChannel);
-
   LOG(("[0x%p] nsDocumentOpenInfo::TryContentListener; mFlags = 0x%x",
        this, mFlags));
 
   NS_PRECONDITION(aListener, "Must have a non-null listener");
   NS_PRECONDITION(aChannel, "Must have a channel");
   
   bool listenerWantsContent = false;
   nsXPIDLCString typeToUse;
@@ -752,18 +727,16 @@ NS_IMETHODIMP nsURILoader::UnRegisterCon
 }
 
 NS_IMETHODIMP nsURILoader::OpenURI(nsIChannel *channel, 
                                    bool aIsContentPreferred,
                                    nsIInterfaceRequestor *aWindowContext)
 {
   NS_ENSURE_ARG_POINTER(channel);
 
-  TIME_URILOADER_FUNCTION(channel);
-
 #ifdef PR_LOGGING
   if (LOG_ENABLED()) {
     nsCOMPtr<nsIURI> uri;
     channel->GetURI(getter_AddRefs(uri));
     nsAutoCString spec;
     uri->GetAsciiSpec(spec);
     LOG(("nsURILoader::OpenURI for %s", spec.get()));
   }
@@ -801,18 +774,16 @@ nsresult nsURILoader::OpenChannel(nsICha
                                   uint32_t aFlags,
                                   nsIInterfaceRequestor* aWindowContext,
                                   bool aChannelIsOpen,
                                   nsIStreamListener** aListener)
 {
   NS_ASSERTION(channel, "Trying to open a null channel!");
   NS_ASSERTION(aWindowContext, "Window context must not be null");
 
-  TIME_URILOADER_FUNCTION(channel);
-
 #ifdef PR_LOGGING
   if (LOG_ENABLED()) {
     nsCOMPtr<nsIURI> uri;
     channel->GetURI(getter_AddRefs(uri));
     nsAutoCString spec;
     uri->GetAsciiSpec(spec);
     LOG(("nsURILoader::OpenChannel for %s", spec.get()));
   }
--- a/widget/android/GfxInfo.cpp
+++ b/widget/android/GfxInfo.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GfxInfo.h"
 #include "nsUnicharUtils.h"
-#include "mozilla/FunctionTimer.h"
 #include "prenv.h"
 #include "prprf.h"
 #include "nsHashKeys.h"
 
 #include "AndroidBridge.h"
 
 #if defined(MOZ_CRASHREPORTER)
 #include "nsExceptionHandler.h"
--- a/widget/cocoa/GfxInfo.mm
+++ b/widget/cocoa/GfxInfo.mm
@@ -5,17 +5,16 @@
 
 #include <OpenGL/OpenGL.h>
 #include <OpenGL/CGLRenderers.h>
 
 #include "mozilla/Util.h"
 
 #include "GfxInfo.h"
 #include "nsUnicharUtils.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsCocoaFeatures.h"
 #include "mozilla/Preferences.h"
 
 #import <Foundation/Foundation.h>
 #import <IOKit/IOKitLib.h>
 #import <Cocoa/Cocoa.h>
 
 #if defined(MOZ_CRASHREPORTER)
@@ -98,18 +97,16 @@ GfxInfo::GetDeviceInfo()
     mAdapterDeviceID.AppendPrintf("0x%4x", IntValueOfCFData((CFDataRef)device_id_ref));
     CFRelease(device_id_ref);
   }
 }
 
 nsresult
 GfxInfo::Init()
 {
-  NS_TIME_FUNCTION;
-
   nsresult rv = GfxInfoBase::Init();
 
   // Calling CGLQueryRendererInfo causes us to switch to the discrete GPU
   // even when we don't want to. We'll avoid doing so for now and just
   // use the device ids.
 #if 0
   CGLRendererInfoObj renderer = 0;
   GLint rendererCount = 0;
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -6,17 +6,16 @@
 #include "mozilla/Util.h"
 
 #include <windows.h>
 #include <setupapi.h>
 #include "gfxWindowsPlatform.h"
 #include "GfxInfo.h"
 #include "GfxInfoWebGL.h"
 #include "nsUnicharUtils.h"
-#include "mozilla/FunctionTimer.h"
 #include "prenv.h"
 #include "prprf.h"
 #include "GfxDriverInfo.h"
 #include "mozilla/Preferences.h"
 #include "nsPrintfCString.h"
 
 #if defined(MOZ_CRASHREPORTER)
 #include "nsExceptionHandler.h"
@@ -237,18 +236,16 @@ ParseIDFromDeviceID(const nsAString &key
  *   IDirectDraw7::GetAvailableVidMem()
  *   e->GetAvailableTextureMem()
  * */
 
 #define DEVICE_KEY_PREFIX L"\\Registry\\Machine\\"
 nsresult
 GfxInfo::Init()
 {
-  NS_TIME_FUNCTION;
-
   nsresult rv = GfxInfoBase::Init();
 
   DISPLAY_DEVICEW displayDevice;
   displayDevice.cb = sizeof(displayDevice);
   int deviceIndex = 0;
 
   mDeviceKeyDebug = NS_LITERAL_STRING("PrimarySearch");
 
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -153,17 +153,16 @@
 #include "nsTextStore.h"
 #endif // defined(NS_ENABLE_TSF)
 
 // Windowless plugin support
 #include "npapi.h"
 
 #include "nsWindowDefs.h"
 
-#include "mozilla/FunctionTimer.h"
 #include "nsCrashOnException.h"
 #include "nsIXULRuntime.h"
 
 #include "nsIContent.h"
 
 using namespace mozilla::widget;
 using namespace mozilla::layers;
 using namespace mozilla;
@@ -1059,28 +1058,16 @@ NS_METHOD nsWindow::Show(bool bState)
     } else {
       if (!sDropShadowEnabled) {
         ::SetClassLongA(mWnd, GCL_STYLE, CS_DROPSHADOW);
         sDropShadowEnabled = true;
       }
     }
   }
 
-#ifdef NS_FUNCTION_TIMER
-  static bool firstShow = true;
-  if (firstShow &&
-      (mWindowType == eWindowType_toplevel ||
-       mWindowType == eWindowType_dialog ||
-       mWindowType == eWindowType_popup))
-  {
-    firstShow = false;
-    mozilla::FunctionTimer::LogMessage("@ First toplevel/dialog/popup showing");
-  }
-#endif
-
   bool syncInvalidate = false;
 
   bool wasVisible = mIsVisible;
   // Set the status now so that anyone asking during ShowWindow or
   // SetWindowPos would get the correct answer.
   mIsVisible = bState;
 
   // We may have cached an out of date visible state. This can happen
@@ -4275,20 +4262,16 @@ DisplaySystemMenu(HWND hWnd, nsSizeMode 
 // and http://msdn.microsoft.com/en-us/library/ms633573%28VS.85%29.aspx
 LRESULT CALLBACK nsWindow::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
   return mozilla::CallWindowProcCrashProtected(WindowProcInternal, hWnd, msg, wParam, lParam);
 }
 
 LRESULT CALLBACK nsWindow::WindowProcInternal(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
-  NS_TIME_FUNCTION_MIN_FMT(5.0, "%s (line %d) (hWnd: %p, msg: %p, wParam: %p, lParam: %p",
-                           MOZ_FUNCTION_NAME, __LINE__, hWnd, msg,
-                           wParam, lParam);
-
   if (::GetWindowLongPtrW(hWnd, GWLP_ID) == eFakeTrackPointScrollableID) {
     // This message was sent to the FAKETRACKPOINTSCROLLABLE.
     if (msg == WM_HSCROLL) {
       // Route WM_HSCROLL messages to the main window.
       hWnd = ::GetParent(::GetParent(hWnd));
     } else {
       // Handle all other messages with its original window procedure.
       WNDPROC prevWindowProc = (WNDPROC)::GetWindowLongPtr(hWnd, GWLP_USERDATA);
deleted file mode 100644
--- a/xpcom/base/FunctionTimer.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// needed to get vsnprintf with glibc
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "prenv.h"
-
-#include "mozilla/FunctionTimer.h"
-
-#ifdef _MSC_VER
-#define vsnprintf _vsnprintf
-#include <windows.h>
-#include <mmsystem.h>
-#endif
-
-using namespace mozilla;
-
-// This /must/ come before the call to InitTimers below,
-// or its constructor will be called after we've already
-// assigned the Now() value to it.
-static TimeStamp sAppStart;
-
-nsAutoPtr<FunctionTimerLog> FunctionTimer::sLog;
-char *FunctionTimer::sBuf1 = nullptr;
-char *FunctionTimer::sBuf2 = nullptr;
-int FunctionTimer::sBufSize = FunctionTimer::InitTimers();
-unsigned FunctionTimer::sDepth = 0;
-
-int
-FunctionTimer::InitTimers()
-{
-    if (PR_GetEnv("MOZ_FT") == NULL)
-        return 0;
-
-    // ensure that this is initialized before us
-    TimeStamp::Startup();
-
-    sLog = new FunctionTimerLog(PR_GetEnv("MOZ_FT"));
-    sBuf1 = (char *) malloc(BUF_LOG_LENGTH);
-    sBuf2 = (char *) malloc(BUF_LOG_LENGTH);
-    sAppStart = TimeStamp::Now();
-
-    return BUF_LOG_LENGTH;
-}
-
-FunctionTimerLog::FunctionTimerLog(const char *fname)
-    : mLatest(sAppStart)
-{
-    if (strcmp(fname, "stdout") == 0) {
-        mFile = stdout;
-    } else if (strcmp(fname, "stderr") == 0) {
-        mFile = stderr;
-    } else {
-        FILE *fp = fopen(fname, "wb");
-        if (!fp) {
-            NS_WARNING("FunctionTimerLog: Failed to open file specified, logging disabled!");
-        }
-        mFile = fp;
-    }
-
-#ifdef _MSC_VER
-    // Get 1ms resolution on Windows
-    timeBeginPeriod(1);
-#endif
-}
-
-FunctionTimerLog::~FunctionTimerLog()
-{
-    if (mFile && mFile != stdout && mFile != stderr)
-        fclose((FILE*)mFile);
-
-#ifdef _MSC_VER
-    timeEndPeriod(1);
-#endif
-}
-
-void
-FunctionTimerLog::LogString(const char *str)
-{
-    if (mFile) {
-        mLatest = TimeStamp::Now();
-        TimeDuration elapsed = mLatest - sAppStart;
-        fprintf((FILE*)mFile, "[% 9.2f] %s\n", elapsed.ToSeconds() * 1000.0, str);
-    }
-}
-
-TimeDuration
-FunctionTimerLog::LatestSinceStartup() const
-{
-    return mLatest - sAppStart;
-}
-
-int
-FunctionTimer::ft_vsnprintf(char *str, int maxlen, const char *fmt, va_list args)
-{
-    return vsnprintf(str, maxlen, fmt, args);
-}
-
-int
-FunctionTimer::ft_snprintf(char *str, int maxlen, const char *fmt, ...)
-{
-    va_list ap;
-    va_start(ap, fmt);
-
-    int rval = ft_vsnprintf(str, maxlen, fmt, ap);
-
-    va_end(ap);
-
-    return rval;
-}
deleted file mode 100644
--- a/xpcom/base/FunctionTimer.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_FunctionTimer_h
-#define mozilla_FunctionTimer_h
-
-#include <stdarg.h>
-
-#include "mozilla/TimeStamp.h"
-#include "nscore.h"
-#include "nsAutoPtr.h"
-
-#if defined(NS_FORCE_FUNCTION_TIMER) && !defined(NS_FUNCTION_TIMER)
-#define NS_FUNCTION_TIMER
-#endif
-
-/*
- * Shortcut macros
- */
-
-#ifdef NS_FUNCTION_TIMER
-
-#ifdef __GNUC__
-#define MOZ_FUNCTION_NAME __PRETTY_FUNCTION__
-#elif defined(_MSC_VER)
-#define MOZ_FUNCTION_NAME __FUNCTION__
-#else
-#warning "Define a suitable MOZ_FUNCTION_NAME for this platform"
-#define MOZ_FUNCTION_NAME ""
-#endif
-
-// Add a timer for this function, from this declaration until the
-// function returns.  The function name will be used as the
-// log string, and both function entry and exit will be printed.
-#define NS_TIME_FUNCTION                                                \
-    mozilla::FunctionTimer ft__autogen("%s (line %d)", MOZ_FUNCTION_NAME, __LINE__)
-
-// Add a timer for this block, but print only a) if the exit time is
-// greater than the given number of milliseconds; or b) if the
-// mark-to-mark time is greater than the given number of milliseconds.
-// No function entry will be printed.  If the value given is negative,
-// no function entry or exit will ever be printed, but all marks will.
-#define NS_TIME_FUNCTION_MIN(_ms)                                       \
-    mozilla::FunctionTimer ft__autogen((_ms), "%s (line %d)", MOZ_FUNCTION_NAME, __LINE__)
-
-// Add a timer for this block, but print only marks, not function
-// entry and exit.  The same as calling the above macro with a negative value.
-#define NS_TIME_FUNCTION_MARK_ONLY                                    \
-    mozilla::FunctionTimer ft__autogen((-1), "%s (line %d)", MOZ_FUNCTION_NAME, __LINE__)
-
-// Add a timer for this block, using the printf-style format.
-// Both function entry and exit will be printed.
-#define NS_TIME_FUNCTION_FMT(...)                                       \
-    mozilla::FunctionTimer ft__autogen(__VA_ARGS__)
-
-// Add a timer for this block, using the given minimum number of
-// milliseconds and the given printf-style format.  No function entry
-// will be printed.
-#define NS_TIME_FUNCTION_MIN_FMT(_ms, ...)                              \
-    mozilla::FunctionTimer ft__autogen((_ms), __VA_ARGS__)
-
-// Add a midway mark for the current timer; an existing timer must
-// have already been created using one of the above macros.  The
-// string given by the printf-style format will be logged, as well as
-// the total elapsed time since the creation of the timer, and the
-// time since the last mark.
-#define NS_TIME_FUNCTION_MARK(...)              \
-    ft__autogen.Mark(__VA_ARGS__)
-
-// A double value representing the time elapsed since NS_TIME_FUNCTION
-// initialization, in ms.
-#define NS_TIME_FUNCTION_ELAPSED              \
-    ft__autogen.Elapsed()
-
-// A double value representing the time elapsed since the last
-// NS_TIME_FUNCTION_MARK, in ms.
-#define NS_TIME_FUNCTION_ELAPSED_SINCE_MARK                             \
-    ft__autogen.ElapsedSinceMark
-
-// A TimeDuration value representing the elapsed time between the
-// last logged event of any sort and the app startup.
-#define NS_TIME_FUNCTION_LATEST \
-    mozilla::FunctionTimer::LatestSinceStartup()
-
-#else
-
-#define NS_TIME_FUNCTION do { } while (0)
-#define NS_TIME_FUNCTION_MIN(_ms) do { } while (0)
-#define NS_TIME_FUNCTION_MARK_ONLY do { } while (0)
-#define NS_TIME_FUNCTION_FMT(...) do { } while (0)
-#define NS_TIME_FUNCTION_MIN_FMT(_ms, ...) do { } while (0)
-#define NS_TIME_FUNCTION_MARK(...) do { } while (0)
-#define NS_TIME_FUNCTION_ELAPSED (0)
-#define NS_TIME_FUNCTION_ELAPSED_SINCE_MARK (0)
-#define NS_TIME_FUNCTION_LATEST (mozilla::TimeDuration(0))
-
-#endif
-
-namespace mozilla {
-
-class FunctionTimerLog
-{
-public:
-    FunctionTimerLog(const char *fname);
-    ~FunctionTimerLog();
-
-    void LogString(const char *str);
-
-    TimeDuration LatestSinceStartup() const;
-
-private:
-    void *mFile;
-    TimeStamp mLatest;
-};
-
-class FunctionTimer
-{
-    static nsAutoPtr<FunctionTimerLog> sLog;
-    static char *sBuf1;
-    static char *sBuf2;
-    static int sBufSize;
-    static unsigned sDepth;
-
-    enum { BUF_LOG_LENGTH = 1024 };
-
-public:
-    static int InitTimers();
-
-    static int ft_vsnprintf(char *str, int maxlen, const char *fmt, va_list args);
-    static int ft_snprintf(char *str, int maxlen, const char *fmt, ...);
-
-    static void LogMessage(const char *s, ...) {
-        va_list ap;
-        va_start(ap, s);
-
-        if (sLog) {
-            ft_vsnprintf(sBuf1, sBufSize, s, ap);
-            sLog->LogString(sBuf1);
-        }
-
-        va_end(ap);
-    }
-
-private:
-    void Init(const char *s, va_list ap) {
-        if (mEnabled) {
-            TimeInit();
-
-            ft_vsnprintf(mString, BUF_LOG_LENGTH, s, ap);
-
-            ft_snprintf(sBuf1, sBufSize, "> (% 3d)%*s|%s%s", mDepth, mDepth, " ", mHasMinMs ? "?MINMS " : "", mString);
-            sLog->LogString(sBuf1);
-        }
-    }
-
-public:
-    inline void TimeInit() {
-        if (mEnabled) {
-            mStart = TimeStamp::Now();
-            mLastMark = mStart;
-        }
-    }
-
-    inline double Elapsed() {
-        if (mEnabled)
-            return (TimeStamp::Now() - mStart).ToSeconds() * 1000.0;
-        return 0.0;
-    }
-
-    inline double ElapsedSinceMark() {
-        if (mEnabled)
-            return (TimeStamp::Now() - mLastMark).ToSeconds() * 1000.0;
-        return 0.0;
-    }
-
-    static inline TimeDuration LatestSinceStartup() {
-        return sLog ? sLog->LatestSinceStartup() : TimeDuration(0);
-    }
-
-    FunctionTimer(double minms, const char *s, ...)
-        : mMinMs(minms), mHasMinMs(true),
-          mEnabled(sLog && s && *s), mDepth(++sDepth)
-    {
-        va_list ap;
-        va_start(ap, s);
-
-        Init(s, ap);
-
-        va_end(ap);
-    }
-
-    FunctionTimer(const char *s, ...)
-        : mMinMs(0.0), mHasMinMs(false),
-          mEnabled(sLog && s && *s), mDepth(++sDepth)
-    {
-        va_list ap;
-        va_start(ap, s);
-
-        Init(s, ap);
-
-        va_end(ap);
-    }
-
-    void Mark(const char *s, ...)
-    {
-        va_list ap;
-        va_start(ap, s);
-
-        if (mEnabled) {
-            ft_vsnprintf(sBuf1, sBufSize, s, ap);
-
-            TimeStamp now(TimeStamp::Now());
-            double ms = (now - mStart).ToSeconds() * 1000.0;
-            double msl = (now - mLastMark).ToSeconds() * 1000.0;
-            mLastMark = now;
-
-            ft_snprintf(sBuf2, sBufSize, "* (% 3d)%*s|%s%9.2f ms (%9.2f ms total) - %s [%s]", mDepth, mDepth, " ",
-                (!mHasMinMs || mMinMs < 0.0 || msl > mMinMs) ? "<MINMS " : "", msl, ms, mString, sBuf1);
-            sLog->LogString(sBuf2);
-        }
-
-        va_end(ap);
-    }
-
-    ~FunctionTimer() {
-        if (mEnabled) {
-            TimeStamp now(TimeStamp::Now());
-            double ms = (now - mStart).ToSeconds() * 1000.0;
-            double msl = (now - mLastMark).ToSeconds() * 1000.0;
-
-            ft_snprintf(sBuf1, sBufSize, "< (% 3d)%*s|%s%9.2f ms (%9.2f ms total) - %s", mDepth, mDepth, " ",
-                (!mHasMinMs || (mMinMs >= 0.0 && msl > mMinMs)) ? "" : "<MINMS ", msl, ms, mString);
-            sLog->LogString(sBuf1);
-        }
-
-        --sDepth;
-    }
-
-    TimeStamp mStart, mLastMark;
-    const double mMinMs;
-    char mString[BUF_LOG_LENGTH+1];
-    const bool mHasMinMs;
-    const bool mEnabled;
-    const unsigned mDepth;
-};
-
-} // namespace mozilla
-
-#endif // mozilla_FunctionTimer_h
-
-
--- a/xpcom/base/Makefile.in
+++ b/xpcom/base/Makefile.in
@@ -32,17 +32,16 @@ CPPSRCS		= \
 		nsMemoryImpl.cpp \
 		nsTraceRefcntImpl.cpp \
 		nsInterfaceRequestorAgg.cpp \
 		nsUUIDGenerator.cpp \
 		nsSystemInfo.cpp \
 		nsCycleCollector.cpp \
 		nsStackWalk.cpp \
 		nsMemoryReporterManager.cpp \
-		FunctionTimer.cpp \
 		ClearOnShutdown.cpp \
 		VisualEventTracer.cpp \
 		$(NULL)
 
 ifeq ($(OS_ARCH),Linux)
 CPPSRCS += MapsMemoryReporter.cpp
 endif
 
@@ -64,17 +63,16 @@ EXPORTS		= \
 		nsWeakPtr.h \
 		nsInterfaceRequestorAgg.h \
 		dmd.h \
 		$(NULL)
 
 EXPORTS_NAMESPACES = mozilla
 
 EXPORTS_mozilla = \
-	FunctionTimer.h \
 	MapsMemoryReporter.h \
 	ClearOnShutdown.h \
 	StaticPtr.h \
 	AvailableMemoryTracker.h \
 	StackWalk.h \
 	VisualEventTracer.h \
 	$(NULL)
 
--- a/xpcom/base/nsStackWalk.cpp
+++ b/xpcom/base/nsStackWalk.cpp
@@ -177,17 +177,16 @@ StackWalkInitCriticalAddress()
 #if defined(_WIN32) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)) // WIN32 x86 stack walking code
 
 #include "nscore.h"
 #include <windows.h>
 #include <process.h>
 #include <stdio.h>
 #include <malloc.h>
 #include "plstr.h"
-#include "mozilla/FunctionTimer.h"
 
 #include "nspr.h"
 #include <imagehlp.h>
 // We need a way to know if we are building for WXP (or later), as if we are, we
 // need to use the newer 64-bit APIs. API_VERSION_NUMBER seems to fit the bill.
 // A value of 9 indicates we want to use the new APIs.
 #if API_VERSION_NUMBER < 9
 #error Too old imagehlp.h
@@ -679,18 +678,16 @@ bool
 EnsureSymInitialized()
 {
     static bool gInitialized = false;
     bool retStat;
 
     if (gInitialized)
         return gInitialized;
 
-    NS_TIME_FUNCTION;
-
     if (!EnsureImageHlpInitialized())
         return false;
 
     SymSetOptions(SYMOPT_LOAD_LINES | SYMOPT_UNDNAME);
     retStat = SymInitialize(GetCurrentProcess(), NULL, TRUE);
     if (!retStat)
         PrintError("SymInitialize");
 
--- a/xpcom/build/nsXPComInit.cpp
+++ b/xpcom/build/nsXPComInit.cpp
@@ -94,17 +94,16 @@ extern nsresult nsStringInputStreamConst
 #include "nsMacUtilsImpl.h"
 #endif
 
 #include "nsSystemInfo.h"
 #include "nsMemoryReporterManager.h"
 
 #include <locale.h>
 #include "mozilla/Services.h"
-#include "mozilla/FunctionTimer.h"
 #include "mozilla/Omnijar.h"
 #include "mozilla/HangMonitor.h"
 #include "mozilla/Telemetry.h"
 
 #include "nsChromeRegistry.h"
 #include "nsChromeProtocolHandler.h"
 #include "mozilla/mozPoisonWrite.h"
 
@@ -308,35 +307,27 @@ NS_InitXPCOM(nsIServiceManager* *result,
     return NS_InitXPCOM2(result, binDirectory, nullptr);
 }
 
 EXPORT_XPCOM_API(nsresult)
 NS_InitXPCOM2(nsIServiceManager* *result,
               nsIFile* binDirectory,
               nsIDirectoryServiceProvider* appFileLocationProvider)
 {
-    NS_TIME_FUNCTION;
-
     nsresult rv = NS_OK;
 
      // We are not shutting down
     gXPCOMShuttingDown = false;
 
-    NS_TIME_FUNCTION_MARK("Next: AvailableMemoryTracker Init()");
-
     // Initialize the available memory tracker before other threads have had a
     // chance to start up, because the initialization is not thread-safe.
     mozilla::AvailableMemoryTracker::Init();
 
-    NS_TIME_FUNCTION_MARK("Next: log init");
-
     NS_LogInit();
 
-    NS_TIME_FUNCTION_MARK("Next: IPC init");
-
     // Set up chromium libs
     NS_ASSERTION(!sExitManager && !sMessageLoop, "Bad logic!");
 
     if (!AtExitManager::AlreadyRegistered()) {
         sExitManager = new AtExitManager();
         NS_ENSURE_STATE(sExitManager);
     }
 
@@ -353,45 +344,35 @@ NS_InitXPCOM2(nsIServiceManager* *result
 
         base::Thread::Options options;
         options.message_loop_type = MessageLoop::TYPE_IO;
         NS_ENSURE_TRUE(ioThread->StartWithOptions(options), NS_ERROR_FAILURE);
 
         sIOThread = ioThread.release();
     }
 
-    NS_TIME_FUNCTION_MARK("Next: thread manager init");
-
     // Establish the main thread here.
     rv = nsThreadManager::get()->Init();
     if (NS_FAILED(rv)) return rv;
 
-    NS_TIME_FUNCTION_MARK("Next: timer startup");
-
     // Set up the timer globals/timer thread
     rv = nsTimerImpl::Startup();
     NS_ENSURE_SUCCESS(rv, rv);
 
 #ifndef ANDROID
-    NS_TIME_FUNCTION_MARK("Next: setlocale");
-
     // If the locale hasn't already been setup by our embedder,
     // get us out of the "C" locale and into the system 
     if (strcmp(setlocale(LC_ALL, NULL), "C") == 0)
         setlocale(LC_ALL, "");
 #endif
 
 #if defined(XP_UNIX) || defined(XP_OS2)
-    NS_TIME_FUNCTION_MARK("Next: startup native charset utils");
-
     NS_StartupNativeCharsetUtils();
 #endif
 
-    NS_TIME_FUNCTION_MARK("Next: startup local file");
-
     NS_StartupLocalFile();
 
     StartupSpecialSystemDirectory();
 
     nsDirectoryService::RealInit();
 
     bool value;
 
@@ -414,26 +395,22 @@ NS_InitXPCOM2(nsIServiceManager* *result
     nsDirectoryService::gService->Get(NS_GRE_DIR,
                                       NS_GET_IID(nsIFile),
                                       getter_AddRefs(xpcomLib));
 
     if (xpcomLib) {
         xpcomLib->AppendNative(nsDependentCString(XPCOM_DLL));
         nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib);
     }
-    
-    NS_TIME_FUNCTION_MARK("Next: Omnijar init");
 
     if (!mozilla::Omnijar::IsInitialized()) {
         mozilla::Omnijar::Init();
     }
 
     if ((sCommandLineWasInitialized = !CommandLine::IsInitialized())) {
-        NS_TIME_FUNCTION_MARK("Next: IPC command line init");
-
 #ifdef OS_WIN
         CommandLine::Init(0, nullptr);
 #else
         nsCOMPtr<nsIFile> binaryFile;
         nsDirectoryService::gService->Get(NS_XPCOM_CURRENT_PROCESS_DIR, 
                                           NS_GET_IID(nsIFile), 
                                           getter_AddRefs(binaryFile));
         NS_ENSURE_STATE(binaryFile);
@@ -447,18 +424,16 @@ NS_InitXPCOM2(nsIServiceManager* *result
         
         static char const *const argv = { strdup(binaryPath.get()) };
         CommandLine::Init(1, &argv);
 #endif
     }
 
     NS_ASSERTION(nsComponentManagerImpl::gComponentManager == NULL, "CompMgr not null at init");
 
-    NS_TIME_FUNCTION_MARK("Next: component manager init");
-
     // Create the Component/Service Manager
     nsComponentManagerImpl::gComponentManager = new nsComponentManagerImpl();
     NS_ADDREF(nsComponentManagerImpl::gComponentManager);
     
     rv = nsCycleCollector_startup();
     if (NS_FAILED(rv)) return rv;
 
     rv = nsComponentManagerImpl::gComponentManager->Init();
@@ -467,36 +442,28 @@ NS_InitXPCOM2(nsIServiceManager* *result
         NS_RELEASE(nsComponentManagerImpl::gComponentManager);
         return rv;
     }
 
     if (result) {
         NS_ADDREF(*result = nsComponentManagerImpl::gComponentManager);
     }
 
-    NS_TIME_FUNCTION_MARK("Next: cycle collector startup");
-
-    NS_TIME_FUNCTION_MARK("Next: interface info manager init");
-
     // The iimanager constructor searches and registers XPT files.
     // (We trigger the singleton's lazy construction here to make that happen.)
     (void) xptiInterfaceInfoManager::GetSingleton();
 
-    NS_TIME_FUNCTION_MARK("Next: register category providers");
-
     // After autoreg, but before we actually instantiate any components,
     // add any services listed in the "xpcom-directory-providers" category
     // to the directory service.
     nsDirectoryService::gService->RegisterCategoryProviders();
 
     mozilla::scache::StartupCache::GetSingleton();
     mozilla::AvailableMemoryTracker::Activate();
 
-    NS_TIME_FUNCTION_MARK("Next: create services from category");
-
     // Notify observers of xpcom autoregistration start
     NS_CreateServicesFromCategory(NS_XPCOM_STARTUP_CATEGORY, 
                                   nullptr,
                                   NS_XPCOM_STARTUP_OBSERVER_ID);
 #ifdef XP_WIN
     ScheduleMediaCacheRemover();
 #endif
 
--- a/xpcom/components/nsCategoryManager.cpp
+++ b/xpcom/components/nsCategoryManager.cpp
@@ -25,17 +25,16 @@
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 #include "nsQuickSort.h"
 #include "nsEnumeratorUtils.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Services.h"
 
 #include "ManifestParser.h"
-#include "mozilla/FunctionTimer.h"
 
 using namespace mozilla;
 class nsIComponentLoaderManager;
 
 /*
   CategoryDatabase
   contains 0 or more 1-1 mappings of string to Category
   each Category contains 0 or more 1-1 mappings of string keys to string values
@@ -727,19 +726,16 @@ nsCategoryManager::SuppressNotifications
  * this will attempt to notify the observer with the origin, observerTopic string
  * as parameter.
  */
 void
 NS_CreateServicesFromCategory(const char *category,
                               nsISupports *origin,
                               const char *observerTopic)
 {
-  NS_TIME_FUNCTION_FMT("NS_CreateServicesFromCategory: %s (%s)",
-                       category, observerTopic ? observerTopic : "(no topic)");
-
   nsresult rv;
 
   nsCOMPtr<nsICategoryManager> categoryManager = 
     do_GetService("@mozilla.org/categorymanager;1");
   if (!categoryManager)
     return;
 
   nsCOMPtr<nsISimpleEnumerator> enumerator;
@@ -762,29 +758,25 @@ NS_CreateServicesFromCategory(const char
     if (NS_FAILED(senumerator->GetNext(entryString)))
       continue;
       
     nsXPIDLCString contractID;
     rv = categoryManager->GetCategoryEntry(category,entryString.get(),
                                            getter_Copies(contractID));
     if (NS_FAILED(rv))
       continue;
-        
-    NS_TIME_FUNCTION_MARK("getservice: %s", contractID.get());
 
     nsCOMPtr<nsISupports> instance = do_GetService(contractID);
     if (!instance) {
       LogMessage("While creating services from category '%s', could not create service for entry '%s', contract ID '%s'",
                  category, entryString.get(), contractID.get());
       continue;
     }
 
     if (observerTopic) {
-      NS_TIME_FUNCTION_MARK("observe: %s", contractID.get());
-
       // try an observer, if it implements it.
       nsCOMPtr<nsIObserver> observer = do_QueryInterface(instance);
       if (observer)
         observer->Observe(origin, observerTopic, EmptyString().get());
       else
         LogMessage("While creating services from category '%s', service for entry '%s', contract ID '%s' does not implement nsIObserver.",
                    category, entryString.get(), contractID.get());
     }
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -52,17 +52,16 @@
 #include "nsXPIDLString.h"
 #include "prcmon.h"
 #include "xptinfo.h" // this after nsISupports, to pick up IID so that xpt stuff doesn't try to define it itself...
 #include "nsThreadUtils.h"
 #include "prthread.h"
 #include "private/pprthred.h"
 #include "nsTArray.h"
 #include "prio.h"
-#include "mozilla/FunctionTimer.h"
 #include "ManifestParser.h"
 #include "mozilla/Services.h"
 
 #include "nsManifestLineReader.h"
 #include "mozilla/GenericFactory.h"
 #include "nsSupportsPrimitives.h"
 #include "nsArrayEnumerator.h"
 #include "nsStringEnumerator.h"
@@ -125,30 +124,16 @@ static const char gIDFormat[] =
     {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} \
 }
 
 NS_DEFINE_CID(kEmptyCID, NS_EMPTY_IID);
 NS_DEFINE_CID(kCategoryManagerCID, NS_CATEGORYMANAGER_CID);
 
 #define UID_STRING_LENGTH 39
 
-#ifdef NS_FUNCTION_TIMER
-#define COMPMGR_TIME_FUNCTION_CID(cid)                                          \
-  char cid_buf__[NSID_LENGTH] = { '\0' };                                      \
-  cid.ToProvidedString(cid_buf__);                                             \
-  NS_TIME_FUNCTION_MIN_FMT(5, "%s (line %d) (cid: %s)", MOZ_FUNCTION_NAME, \
-                           __LINE__, cid_buf__)
-#define COMPMGR_TIME_FUNCTION_CONTRACTID(cid)                                  \
-  NS_TIME_FUNCTION_MIN_FMT(5, "%s (line %d) (contractid: %s)", MOZ_FUNCTION_NAME, \
-                           __LINE__, (cid))
-#else
-#define COMPMGR_TIME_FUNCTION_CID(cid) do {} while (0)
-#define COMPMGR_TIME_FUNCTION_CONTRACTID(cid) do {} while (0)
-#endif
-
 nsresult
 nsGetServiceFromCategory::operator()(const nsIID& aIID, void** aInstancePtr) const
 {
     nsresult rv;
     nsXPIDLCString value;
     nsCOMPtr<nsICategoryManager> catman;
     nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
     if (!compMgr) {
@@ -289,27 +274,24 @@ nsComponentManagerImpl::InitializeModule
     if (sModuleLocations)
         return;
 
     sModuleLocations = new nsTArray<ComponentLocation>;
 }
 
 nsresult nsComponentManagerImpl::Init()
 {
-    NS_TIME_FUNCTION;
-
     PR_ASSERT(NOT_INITIALIZED == mStatus);
 
     if (nsComponentManagerLog == nullptr)
     {
         nsComponentManagerLog = PR_NewLogModule("nsComponentManager");
     }
 
     // Initialize our arena
-    NS_TIME_FUNCTION_MARK("Next: init component manager arena");
     PL_INIT_ARENA_POOL(&mArena, "ComponentManagerArena", NS_CM_BLOCK_SIZE);
 
     mFactories.Init(CONTRACTID_HASHTABLE_INITIAL_SIZE);
     mContractIDs.Init(CONTRACTID_HASHTABLE_INITIAL_SIZE);
     mLoaderMap.Init();
     mKnownModules.Init();
 
     nsCOMPtr<nsIFile> greDir =
@@ -332,17 +314,16 @@ nsresult nsComponentManagerImpl::Init()
         cl->type = NS_COMPONENT_LOCATION;
         lf = CloneAndAppend(greDir, NS_LITERAL_CSTRING("chrome.manifest"));
         cl->location.Init(lf);
     }
 
     PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG,
            ("nsComponentManager: Initialized."));
 
-    NS_TIME_FUNCTION_MARK("Next: init native module loader");
     nsresult rv = mNativeModuleLoader.Init();
     if (NS_FAILED(rv))
         return rv;
 
     nsCategoryManager::GetSingleton()->SuppressNotifications(true);
 
     RegisterModule(&kXPCOMModule, NULL);
 
@@ -715,18 +696,16 @@ nsComponentManagerImpl::KnownModule::Des
         mFile.GetURIString(s);
     else
         s = "<static module>";
     return s;
 }
 
 nsresult nsComponentManagerImpl::Shutdown(void)
 {
-    NS_TIME_FUNCTION;
-
     PR_ASSERT(NORMAL == mStatus);
 
     mStatus = SHUTDOWN_IN_PROGRESS;
 
     // Shutdown the component manager
     PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Beginning Shutdown."));
 
     // Release all cached factories
@@ -893,18 +872,16 @@ nsComponentManagerImpl::GetClassObjectBy
  * released and not held onto for any longer.
  */
 NS_IMETHODIMP
 nsComponentManagerImpl::CreateInstance(const nsCID &aClass,
                                        nsISupports *aDelegate,
                                        const nsIID &aIID,
                                        void **aResult)
 {
-    COMPMGR_TIME_FUNCTION_CID(aClass);
-
     // test this first, since there's no point in creating a component during
     // shutdown -- whether it's available or not would depend on the order it
     // occurs in the list
     if (gXPCOMShuttingDown) {
         // When processing shutdown, don't process new GetService() requests
 #ifdef SHOW_DENIED_ON_SHUTDOWN
         nsXPIDLCString cid, iid;
         cid.Adopt(aClass.ToString());
@@ -977,18 +954,16 @@ nsComponentManagerImpl::CreateInstance(c
  * CreateInstance() with classid and iid.
  */
 NS_IMETHODIMP
 nsComponentManagerImpl::CreateInstanceByContractID(const char *aContractID,
                                                    nsISupports *aDelegate,
                                                    const nsIID &aIID,
                                                    void **aResult)
 {
-    COMPMGR_TIME_FUNCTION_CONTRACTID(aContractID);
-
     NS_ENSURE_ARG_POINTER(aContractID);
 
     // test this first, since there's no point in creating a component during
     // shutdown -- whether it's available or not would depend on the order it
     // occurs in the list
     if (gXPCOMShuttingDown) {
         // When processing shutdown, don't process new GetService() requests
 #ifdef SHOW_DENIED_ON_SHUTDOWN
@@ -1177,19 +1152,16 @@ nsComponentManagerImpl::GetService(const
         return NS_ERROR_FACTORY_NOT_REGISTERED;
 
     if (entry->mServiceObject) {
         nsCOMPtr<nsISupports> supports = entry->mServiceObject;
         mon.Exit();
         return supports->QueryInterface(aIID, result);
     }
 
-    // We only care about time when we create the service.
-    COMPMGR_TIME_FUNCTION_CID(aClass);
-
     PRThread* currentPRThread = PR_GetCurrentThread();
     NS_ASSERTION(currentPRThread, "This should never be null!");
 
     // Needed to optimize the event loop below.
     nsIThread* currentThread = nullptr;
 
     PRThread* pendingPRThread;
     while ((pendingPRThread = GetPendingServiceThread(aClass))) {
@@ -1260,18 +1232,16 @@ nsComponentManagerImpl::GetService(const
     return rv;
 }
 
 NS_IMETHODIMP
 nsComponentManagerImpl::IsServiceInstantiated(const nsCID & aClass,
                                               const nsIID& aIID,
                                               bool *result)
 {
-    COMPMGR_TIME_FUNCTION_CID(aClass);
-
     // Now we want to get the service if we already got it. If not, we don't want
     // to create an instance of it. mmh!
 
     // test this first, since there's no point in returning a service during
     // shutdown -- whether it's available or not would depend on the order it
     // occurs in the list
     if (gXPCOMShuttingDown) {
         // When processing shutdown, don't process new GetService() requests
@@ -1301,18 +1271,16 @@ nsComponentManagerImpl::IsServiceInstant
 
     return rv;
 }
 
 NS_IMETHODIMP nsComponentManagerImpl::IsServiceInstantiatedByContractID(const char *aContractID,
                                                                         const nsIID& aIID,
                                                                         bool *result)
 {
-    COMPMGR_TIME_FUNCTION_CONTRACTID(aContractID);
-
     // Now we want to get the service if we already got it. If not, we don't want
     // to create an instance of it. mmh!
 
     // test this first, since there's no point in returning a service during
     // shutdown -- whether it's available or not would depend on the order it
     // occurs in the list
     if (gXPCOMShuttingDown) {
         // When processing shutdown, don't process new GetService() requests
@@ -1372,19 +1340,16 @@ nsComponentManagerImpl::GetServiceByCont
         // We need to not be holding the service manager's monitor while calling
         // QueryInterface, because it invokes user code which could try to re-enter
         // the service manager, or try to grab some other lock/monitor/condvar
         // and deadlock, e.g. bug 282743.
         mon.Exit();
         return serviceObject->QueryInterface(aIID, result);
     }
 
-    // We only care about time when we create the service.
-    COMPMGR_TIME_FUNCTION_CONTRACTID(aContractID);
-
     PRThread* currentPRThread = PR_GetCurrentThread();
     NS_ASSERTION(currentPRThread, "This should never be null!");
 
     // Needed to optimize the event loop below.
     nsIThread* currentThread = nullptr;
 
     PRThread* pendingPRThread;
     while ((pendingPRThread = GetPendingServiceThread(*entry->mCIDEntry->cid))) {
@@ -1595,18 +1560,16 @@ EnumerateCIDHelper(const nsID& id, nsFac
     wrapper->SetData(&id);
     array->AppendObject(wrapper);
     return PL_DHASH_NEXT;
 }
 
 NS_IMETHODIMP
 nsComponentManagerImpl::EnumerateCIDs(nsISimpleEnumerator **aEnumerator)
 {
-    NS_TIME_FUNCTION;
-
     nsCOMArray<nsISupports> array;
     mFactories.EnumerateRead(EnumerateCIDHelper, &array);
 
     return NS_NewArrayEnumerator(aEnumerator, array);
 }
 
 static PLDHashOperator
 EnumerateContractsHelper(const nsACString& contract, nsFactoryEntry* entry, void* closure)
@@ -1614,18 +1577,16 @@ EnumerateContractsHelper(const nsACStrin
     nsTArray<nsCString>* array = static_cast<nsTArray<nsCString>*>(closure);
     array->AppendElement(contract);
     return PL_DHASH_NEXT;
 }
 
 NS_IMETHODIMP
 nsComponentManagerImpl::EnumerateContractIDs(nsISimpleEnumerator **aEnumerator)
 {
-    NS_TIME_FUNCTION;
-
     nsTArray<nsCString>* array = new nsTArray<nsCString>;
     mContractIDs.EnumerateRead(EnumerateContractsHelper, array);
 
     nsCOMPtr<nsIUTF8StringEnumerator> e;
     nsresult rv = NS_NewAdoptingUTF8StringEnumerator(getter_AddRefs(e), array);
     if (NS_FAILED(rv))
         return rv;
 
--- a/xpcom/glue/FileUtils.cpp
+++ b/xpcom/glue/FileUtils.cpp
@@ -12,22 +12,20 @@
 #elif defined(XP_OS2)
 #define INCL_DOSFILEMGR
 #include <os2.h>
 #endif
 
 #include "nscore.h"
 #include "private/pprio.h"
 #include "mozilla/FileUtils.h"
-#include "mozilla/FunctionTimer.h"
 
 bool 
 mozilla::fallocate(PRFileDesc *aFD, int64_t aLength) 
 {
-  NS_TIME_FUNCTION;
 #if defined(HAVE_POSIX_FALLOCATE)
   return posix_fallocate(PR_FileDesc2NativeHandle(aFD), 0, aLength) == 0;
 #elif defined(XP_WIN)
   int64_t oldpos = PR_Seek64(aFD, 0, PR_SEEK_CUR);
   if (oldpos == -1)
     return false;
 
   if (PR_Seek64(aFD, aLength, PR_SEEK_SET) != aLength)
--- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp
+++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp
@@ -5,17 +5,16 @@
 
 /* Implementation of xptiInterfaceInfoManager. */
 
 #include "xptiprivate.h"
 #include "nsDependentString.h"
 #include "nsString.h"
 #include "nsISupportsArray.h"
 #include "nsArrayEnumerator.h"
-#include "mozilla/FunctionTimer.h"
 #include "nsDirectoryService.h"
 #include "mozilla/FileUtils.h"
 #include "nsIMemoryReporter.h"
 
 using namespace mozilla;
 
 NS_IMPL_THREADSAFE_ISUPPORTS2(xptiInterfaceInfoManager, 
                               nsIInterfaceInfoManager,
@@ -61,18 +60,16 @@ NS_MEMORY_REPORTER_IMPLEMENT(xptiWorking
                              xptiInterfaceInfoManager::GetXPTIWorkingSetSize,
                              "Memory used by the XPCOM typelib system.")
 
 // static
 xptiInterfaceInfoManager*
 xptiInterfaceInfoManager::GetSingleton()
 {
     if (!gInterfaceInfoManager) {
-        NS_TIME_FUNCTION;
-
         gInterfaceInfoManager = new xptiInterfaceInfoManager();
         NS_ADDREF(gInterfaceInfoManager);
     }
     return gInterfaceInfoManager;
 }
 
 void
 xptiInterfaceInfoManager::FreeInterfaceInfoManager()
@@ -330,18 +327,16 @@ NS_IMETHODIMP xptiInterfaceInfoManager::
     mWorkingSet.mNameTable.EnumerateRead(xpti_ArrayPrefixAppender, &args);
 
     return array->Enumerate(_retval);
 }
 
 /* void autoRegisterInterfaces (); */
 NS_IMETHODIMP xptiInterfaceInfoManager::AutoRegisterInterfaces()
 {
-    NS_TIME_FUNCTION;
-
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 /***************************************************************************/
 
 /* void addAdditionalManager (in nsIInterfaceInfoManager manager); */
 NS_IMETHODIMP xptiInterfaceInfoManager::AddAdditionalManager(nsIInterfaceInfoManager *manager)
 {
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -25,17 +25,16 @@
 # define MOZ_CANARY
 # include <unistd.h>
 # include <execinfo.h>
 # include <signal.h>
 # include <fcntl.h>
 # include "nsXULAppAPI.h"
 #endif
 
-#include "mozilla/FunctionTimer.h"
 #if defined(NS_FUNCTION_TIMER) && defined(_MSC_VER)
 #include "nsTimerImpl.h"
 #include "nsStackWalk.h"
 #endif
 #ifdef NS_FUNCTION_TIMER
 #include "nsCRT.h"
 #endif
 
@@ -599,27 +598,16 @@ nsThread::ProcessNextEvent(bool mayWait,
     // Scope for |event| to make sure that its destructor fires while
     // mRunningEvent has been incremented, since that destructor can
     // also do work.
 
     // If we are shutting down, then do not wait for new events.
     nsCOMPtr<nsIRunnable> event;
     mEvents.GetEvent(mayWait && !ShuttingDown(), getter_AddRefs(event));
 
-#ifdef NS_FUNCTION_TIMER
-    char message[1024] = {'\0'};
-    if (MAIN_THREAD == mIsMainThread) {
-        mozilla::FunctionTimer::ft_snprintf(message, sizeof(message), 
-                                            "@ Main Thread Event %p", (void*)event.get());
-    }
-    // If message is empty, it means that we're not on the main thread, and
-    // FunctionTimer won't time this function.
-    NS_TIME_FUNCTION_MIN_FMT(5.0, message);
-#endif
-
     *result = (event.get() != nullptr);
 
     if (event) {
       LOG(("THRD(%p) running [%p]\n", this, event.get()));
       if (MAIN_THREAD == mIsMainThread)
         HangMonitor::NotifyActivity();
       event->Run();
     } else if (mayWait) {