From 13b6fe1db5fba655cc1d0f500f4f5eaa03a0d05f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 12 Dec 2020 17:12:50 +0100 Subject: [PATCH] chore: setup for profiling --- package.yaml | 2 -- src/Foundation/Authorization.hs | 2 +- src/Foundation/SiteLayout.hs | 1 + src/Foundation/Yesod/Middleware.hs | 2 +- src/Jobs.hs | 2 ++ src/Model/Types/TH/JSON.hs | 1 + stack.yaml | 4 ++++ 7 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package.yaml b/package.yaml index 3edadbdb6..5d17193ee 100644 --- a/package.yaml +++ b/package.yaml @@ -247,8 +247,6 @@ when: - -ddump-splices - -ddump-to-file cpp-options: -DDEVELOPMENT - ghc-prof-options: - - -fprof-auto else: ghc-options: - -O -fllvm diff --git a/src/Foundation/Authorization.hs b/src/Foundation/Authorization.hs index d8dc47961..c69a93ba3 100644 --- a/src/Foundation/Authorization.hs +++ b/src/Foundation/Authorization.hs @@ -1,5 +1,5 @@ {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} +{-# OPTIONS_GHC -fno-warn-redundant-constraints -fprof-auto #-} module Foundation.Authorization ( evalAccess, evalAccessFor, evalAccessWith diff --git a/src/Foundation/SiteLayout.hs b/src/Foundation/SiteLayout.hs index 8a6d86e2f..c21e114c5 100644 --- a/src/Foundation/SiteLayout.hs +++ b/src/Foundation/SiteLayout.hs @@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-} -- for `MemcachedKeyFavourites` +{-# OPTIONS_GHC -fprof-auto #-} module Foundation.SiteLayout ( siteLayout', siteLayout diff --git a/src/Foundation/Yesod/Middleware.hs b/src/Foundation/Yesod/Middleware.hs index b78cfb20d..473f50de3 100644 --- a/src/Foundation/Yesod/Middleware.hs +++ b/src/Foundation/Yesod/Middleware.hs @@ -1,4 +1,4 @@ -{-# OPTIONS_GHC -O0 -fasm #-} +{-# OPTIONS_GHC -O0 -fasm -fprof-auto #-} module Foundation.Yesod.Middleware ( yesodMiddleware diff --git a/src/Jobs.hs b/src/Jobs.hs index 19cd9b560..4aca345e8 100644 --- a/src/Jobs.hs +++ b/src/Jobs.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fprof-auto #-} + module Jobs ( module Types , module Jobs.Queue diff --git a/src/Model/Types/TH/JSON.hs b/src/Model/Types/TH/JSON.hs index 5320d6174..2fdeddca9 100644 --- a/src/Model/Types/TH/JSON.hs +++ b/src/Model/Types/TH/JSON.hs @@ -25,6 +25,7 @@ fromPersistValueJSON = \case PersistText text -> decodeBS $ Text.encodeUtf8 text _other -> Left "JSON values must be converted from PersistDbSpecific, PersistText, or PersistByteString" where decodeBS = first pack . JSON.eitherDecodeStrict' +{-# SCC fromPersistValueJSON #-} sqlTypeJSON :: SqlType sqlTypeJSON = SqlOther "jsonb" diff --git a/stack.yaml b/stack.yaml index f9ba959f9..a11936f9b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -2,6 +2,10 @@ flags: aeson: cffi: true +rebuild-ghc-options: true +ghc-options: + "$everything": -fno-prof-auto + nix: packages: [] pure: false