From 00124fe9b4287689160369a073bf645c3f196bc8 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Wed, 11 Mar 2020 17:29:47 -0400 Subject: [PATCH] Make the Span field of a file lazy. Computing the full span of a file with a large (100,000+ line) file can be very computationally intensive. Switching to a lazy field means that we don't pay that cost unless we need to. Big hattip to @tclem for triaging this issue. --- semantic-analysis/src/Analysis/File.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semantic-analysis/src/Analysis/File.hs b/semantic-analysis/src/Analysis/File.hs index cfaeaac9e..fd00e2d7e 100644 --- a/semantic-analysis/src/Analysis/File.hs +++ b/semantic-analysis/src/Analysis/File.hs @@ -16,7 +16,7 @@ import qualified System.Path.PartClass as Path.PartClass data File a = File { filePath :: !Path.AbsRelFile - , fileSpan :: {-# UNPACK #-} !Span + , fileSpan :: Span , fileBody :: !a } deriving (Eq, Foldable, Functor, Ord, Show, Traversable)