Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Performance #7

Open
gdevanla opened this issue Oct 2, 2021 · 6 comments
Open

Improve Performance #7

gdevanla opened this issue Oct 2, 2021 · 6 comments

Comments

@gdevanla
Copy link
Owner

gdevanla commented Oct 2, 2021

Currently, the Interpreter is too slow compared to the speed of the corresponding Java interpreter as listed here:
https://craftinginterpreters.com/chunks-of-bytecode.html. The Java version takes around 72 seconds,

But, the current Haskell version takes a lot longer. Some details follow:

Here is the corresponding lox code:

t1.lox

fun fib(n) {
    if (n<=1) { return n;}
    return fib(n-2) + fib(n-1);
}

var k = 40;
print k;
print fib(k);
$ stack build --ghc-options -O2
$ time .stack-work/dist/x86_64-linux/Cabal-3.2.1.0/build/scanner-exe-1/scanner-exe-1 t1.lox
40.0
1.02334155e8
.stack-work/dist/x86_64-linux/Cabal-3.2.1.0/build/scanner-exe-1/scanner-exe-1  800.59s user 120.05s system 416% cpu 3:41.00 total

# for 35, we have the following speed
$ time .stack-work/dist/x86_64-linux/Cabal-3.2.1.0/build/scanner-exe-1/scanner-exe-1 t1.lox
35.0
9227465.0
.stack-work/dist/x86_64-linux/Cabal-3.2.1.0/build/scanner-exe-1/scanner-exe-1  60.56s user 7.45s system 381% cpu 17.807 total

You see that the Haskell version takes much longer.

Here are some performance stats that I collected so far for n=35.

# Build the exe with profiling options

$ stack clean
$ stack build --ddump-dir hloc --color=always --ghc-options -fforce-recomp  --ghc-options -rtsopts --executable-profiling --library-profiling --ghc-options -auto-all --ghc-options -fprof-cafs --ghc-options -O2

$ time .stack-work/dist/x86_64-linux/Cabal-3.2.1.0/build/scanner-exe-1/scanner-exe-1 t1.lox +RTS -hc -p   

Here is the entire listing of the profile. As expected, the interpreter is the highest cost center. I feel like I could some how reduce the cost of some operations I am doing while applyCompOpToDouble or lookupEnv or insertEnv. I believe the too much cycles are spent creating new versions of the Map.
scanner-exe-1.prof.txt

	Sat Oct  2 09:51 2021 Time and Allocation Profiling Report  (Final)

	   scanner-exe-1 +RTS -N -hc -p -RTS t1.lox

	total time  =        9.48 secs   (32311 ticks @ 1000 us, 12 processors)
	total alloc = 78,595,007,312 bytes  (excludes profiling overheads)

COST CENTRE            MODULE          SRC                                       %time %alloc

interpret              ExprInterpreter src/ExprInterpreter.hs:(133,1)-(219,101)   61.1   55.2
lookupEnv.go           ExprInterpreter src/ExprInterpreter.hs:(62,5)-(65,24)       6.1    2.1
interpretStmt          ExprInterpreter src/ExprInterpreter.hs:(222,1)-(268,84)     5.2    4.9
insertEnv              ExprInterpreter src/ExprInterpreter.hs:78:1-55              4.2    6.7
interpretProgram.go    ExprInterpreter src/ExprInterpreter.hs:(296,5)-(301,35)     3.0    6.1
applyOpToDouble        ExprInterpreter src/ExprInterpreter.hs:(108,1)-(118,19)     2.9    5.5
applyCompOpToDouble    ExprInterpreter src/ExprInterpreter.hs:(120,1)-(130,19)     2.6    4.9
unpackIdent            ExprInterpreter src/ExprInterpreter.hs:(97,1)-(103,33)      2.4    4.6
interpret.pa           ExprInterpreter src/ExprInterpreter.hs:206:11-33            1.9    3.0
multiInsertEnv.new_env ExprInterpreter src/ExprInterpreter.hs:82:3-29              1.7    1.8
interpret.s            ExprInterpreter src/ExprInterpreter.hs:208:11-57            1.7    2.4
interpret.f            ExprInterpreter src/ExprInterpreter.hs:(217,5)-(219,101)    1.5    2.1
interpretDeclaration   ExprInterpreter src/ExprInterpreter.hs:(272,1)-(291,25)     1.4    0.0
lookupEnv              ExprInterpreter src/ExprInterpreter.hs:(60,1)-(65,24)       1.3    0.0


                                                                                                                                             individual      inherited
COST CENTRE                                          MODULE                  SRC                                         no.      entries  %time %alloc   %time %alloc

MAIN                                                 MAIN                    <built-in>                                  2298           0    0.0    0.0   100.0  100.0
 CAF                                                 GHC.Conc.Signal         <entire-module>                             2410           0    0.0    0.0     0.0    0.0
 CAF                                                 GHC.Float               <entire-module>                             2401           0    0.0    0.0     0.0    0.0
 CAF                                                 GHC.IO.Encoding         <entire-module>                             2391           0    0.0    0.0     0.0    0.0
 CAF                                                 GHC.IO.Encoding.Iconv   <entire-module>                             2389           0    0.0    0.0     0.0    0.0
 CAF                                                 GHC.IO.Encoding.UTF8    <entire-module>                             2384           0    0.0    0.0     0.0    0.0
 CAF                                                 GHC.IO.FD               <entire-module>                             2382           0    0.0    0.0     0.0    0.0
 CAF                                                 GHC.IO.Handle.FD        <entire-module>                             2380           0    0.0    0.0     0.0    0.0
 CAF                                                 GHC.IO.Handle.Text      <entire-module>                             2378           0    0.0    0.0     0.0    0.0
 CAF                                                 Text.Read.Lex           <entire-module>                             2336           0    0.0    0.0     0.0    0.0
 CAF                                                 GHC.Event.Thread        <entire-module>                             2329           0    0.0    0.0     0.0    0.0
 CAF                                                 GHC.Event.Poll          <entire-module>                             2315           0    0.0    0.0     0.0    0.0
 CAF:$fDisplayIOException2                           RIO.Prelude.Display     <no location info>                          4091           0    0.0    0.0     0.0    0.0
  fromString                                         RIO.Prelude.Display     src/RIO/Prelude/Display.hs:47:3-42          4615           1    0.0    0.0     0.0    0.0
 CAF:$fFunctorRIO1                                   RIO.Prelude.RIO         <no location info>                          3982           0    0.0    0.0     0.0    0.0
  <$                                                 RIO.Prelude.RIO         src/RIO/Prelude/RIO.hs:40:13-19             4634           1    0.0    0.0     0.0    0.0
 CAF:$fFunctorRIO2                                   RIO.Prelude.RIO         <no location info>                          3983           0    0.0    0.0     0.0    0.0
  fmap                                               RIO.Prelude.RIO         src/RIO/Prelude/RIO.hs:40:13-19             4632           1    0.0    0.0     0.0    0.0
 CAF:$fMonadIORIO1                                   RIO.Prelude.RIO         <no location info>                          3973           0    0.0    0.0     0.0    0.0
  liftIO                                             RIO.Prelude.RIO         src/RIO/Prelude/RIO.hs:40:39-45             4631           1    0.0    0.0     0.0    0.0
 CAF:$fMonadRIO3                                     RIO.Prelude.RIO         <no location info>                          3976           0    0.0    0.0     0.0    0.0
  >>=                                                RIO.Prelude.RIO         src/RIO/Prelude/RIO.hs:40:33-37             4629           1    0.0    0.0     0.0    0.0
 CAF:assignment1                                     ExprParser              <no location info>                          4428           0    0.0    0.0     0.0    0.0
  assignment                                         ExprParser              src/ExprParser.hs:(241,1)-(252,26)          4775           1    0.0    0.0     0.0    0.0
 CAF:assignment3                                     ExprParser              <no location info>                          4407           0    0.0    0.0     0.0    0.0
  assignment                                         ExprParser              src/ExprParser.hs:(241,1)-(252,26)          4777           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4778           1    0.0    0.0     0.0    0.0
 CAF:call1                                           ExprParser              <no location info>                          4429           0    0.0    0.0     0.0    0.0
  call                                               ExprParser              src/ExprParser.hs:(182,1)-(192,52)          4807           1    0.0    0.0     0.0    0.0
 CAF:call2                                           ExprParser              <no location info>                          4441           0    0.0    0.0     0.0    0.0
  loxPrimary                                         ExprParser              src/ExprParser.hs:168:1-89                  4809           1    0.0    0.0     0.0    0.0
 CAF:checkIfIdentifier_rcph                          Scanner                 <no location info>                          4359           0    0.0    0.0     0.0    0.0
  checkIfIdentifier                                  Scanner                 src/Scanner.hs:(212,1)-(220,70)             4661           1    0.0    0.0     0.0    0.0
 CAF:comma1                                          ExprParser              <no location info>                          4399           0    0.0    0.0     0.0    0.0
  comma                                              ExprParser              src/ExprParser.hs:(280,1)-(284,18)          4748           1    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4749           1    0.0    0.0     0.0    0.0
 CAF:comparison                                      ExprParser              src/ExprParser.hs:223:1-10                  4434           0    0.0    0.0     0.0    0.0
  comparison                                         ExprParser              src/ExprParser.hs:(223,1)-(230,18)          4791           1    0.0    0.0     0.0    0.0
   leftChain                                         ExprParser              src/ExprParser.hs:(99,1)-(108,47)           4792           1    0.0    0.0     0.0    0.0
 CAF:comparison1                                     ExprParser              <no location info>                          4412           0    0.0    0.0     0.0    0.0
  comparison                                         ExprParser              src/ExprParser.hs:(223,1)-(230,18)          4893           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4894           1    0.0    0.0     0.0    0.0
 CAF:cs2_rcnC                                        Scanner                 <no location info>                          4285           0    0.0    0.0     0.0    0.0
 CAF:defaultLogColors                                RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:492:1-16          4029           0    0.0    0.0     0.0    0.0
  defaultLogColors                                   RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(492,1)-(496,3)   4613           1    0.0    0.0     0.0    0.0
 CAF:elseStmt1_rpAt                                  ExprParser              <no location info>                          4472           0    0.0    0.0     0.0    0.0
  ifStmt                                             ExprParser              src/ExprParser.hs:(306,1)-(323,18)          4959           0    0.0    0.0     0.0    0.0
   ifStmt.elseStmt                                   ExprParser              src/ExprParser.hs:(321,5)-(323,18)          4960           1    0.0    0.0     0.0    0.0
 CAF:equality                                        ExprParser              src/ExprParser.hs:233:1-8                   4435           0    0.0    0.0     0.0    0.0
  equality                                           ExprParser              src/ExprParser.hs:(233,1)-(238,18)          4787           1    0.0    0.0     0.0    0.0
   leftChain                                         ExprParser              src/ExprParser.hs:(99,1)-(108,47)           4788           1    0.0    0.0     0.0    0.0
 CAF:equality1                                       ExprParser              <no location info>                          4411           0    0.0    0.0     0.0    0.0
  equality                                           ExprParser              src/ExprParser.hs:(233,1)-(238,18)          4900           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4901           1    0.0    0.0     0.0    0.0
 CAF:eta1_rcqB                                       Scanner                 <no location info>                          4375           0    0.0    0.0     0.0    0.0
  scanDouble                                         Scanner                 src/Scanner.hs:(169,1)-(181,73)             4697           0    0.0    0.0     0.0    0.0
   scanDouble.secondCharacter                        Scanner                 src/Scanner.hs:(178,5)-(181,73)             4698           0    0.0    0.0     0.0    0.0
 CAF:eta1_rpzM                                       ExprParser              <no location info>                          4422           0    0.0    0.0     0.0    0.0
  ifStmt                                             ExprParser              src/ExprParser.hs:(306,1)-(323,18)          4962           0    0.0    0.0     0.0    0.0
   ifStmt.elseStmt                                   ExprParser              src/ExprParser.hs:(321,5)-(323,18)          4963           0    0.0    0.0     0.0    0.0
    satisfyT                                         ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4964           1    0.0    0.0     0.0    0.0
 CAF:eta2_rpAj                                       ExprParser              <no location info>                          4426           0    0.0    0.0     0.0    0.0
  loxFuncDecl                                        ExprParser              src/ExprParser.hs:(385,1)-(399,39)          4753           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4754           1    0.0    0.0     0.0    0.0
 CAF:eta3_rpAr                                       ExprParser              <no location info>                          4463           0    0.0    0.0     0.0    0.0
  loxFuncDecl                                        ExprParser              src/ExprParser.hs:(385,1)-(399,39)          4734           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4735           1    0.0    0.0     0.0    0.0
 CAF:eta_rpzK                                        ExprParser              <no location info>                          4408           0    0.0    0.0     0.0    0.0
  assignment                                         ExprParser              src/ExprParser.hs:(241,1)-(252,26)          4850           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4851           1    0.0    0.0     0.0    0.0
 CAF:factor                                          ExprParser              src/ExprParser.hs:206:1-6                   4432           0    0.0    0.0     0.0    0.0
  factor                                             ExprParser              src/ExprParser.hs:(206,1)-(211,18)          4797           1    0.0    0.0     0.0    0.0
   leftChain                                         ExprParser              src/ExprParser.hs:(99,1)-(108,47)           4798           1    0.0    0.0     0.0    0.0
 CAF:factor1                                         ExprParser              <no location info>                          4414           0    0.0    0.0     0.0    0.0
  factor                                             ExprParser              src/ExprParser.hs:(206,1)-(211,18)          4879           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4880           1    0.0    0.0     0.0    0.0
 CAF:factor5                                         ExprParser              <no location info>                          4431           0    0.0    0.0     0.0    0.0
  unary                                              ExprParser              src/ExprParser.hs:179:1-27                  4800           1    0.0    0.0     0.0    0.0
 CAF:funcCall1                                       ExprParser              <no location info>                          4443           0    0.0    0.0     0.0    0.0
  funcCall                                           ExprParser              src/ExprParser.hs:(195,1)-(199,31)          4872           1    0.0    0.0     0.0    0.0
 CAF:funcCall4                                       ExprParser              <no location info>                          4425           0    0.0    0.0     0.0    0.0
  funcCall                                           ExprParser              src/ExprParser.hs:(195,1)-(199,31)          4977           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4978           1    0.0    0.0     0.0    0.0
 CAF:funcCall5                                       ExprParser              <no location info>                          4442           0    0.0    0.0     0.0    0.0
  loxArguments                                       ExprParser              src/ExprParser.hs:202:1-34                  4967           1    0.0    0.0     0.0    0.0
 CAF:funcCall6                                       ExprParser              <no location info>                          4438           0    0.0    0.0     0.0    0.0
  loxExpr                                            ExprParser              src/ExprParser.hs:255:1-39                  4773           1    0.0    0.0     0.0    0.0
 CAF:funcCall8                                       ExprParser              <no location info>                          4427           0    0.0    0.0     0.0    0.0
  funcCall                                           ExprParser              src/ExprParser.hs:(195,1)-(199,31)          4874           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4875           1    0.0    0.0     0.0    0.0
 CAF:identifier1                                     ExprParser              <no location info>                          4401           0    0.0    0.0     0.0    0.0
  identifier                                         ExprParser              src/ExprParser.hs:(413,1)-(417,18)          4729           1    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4730           1    0.0    0.0     0.0    0.0
 CAF:ifStmt1                                         ExprParser              <no location info>                          4465           0    0.0    0.0     0.0    0.0
  ifStmt                                             ExprParser              src/ExprParser.hs:(306,1)-(323,18)          4843           1    0.0    0.0     0.0    0.0
 CAF:ifStmt11                                        ExprParser              <no location info>                          4421           0    0.0    0.0     0.0    0.0
  ifStmt                                             ExprParser              src/ExprParser.hs:(306,1)-(323,18)          4845           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4846           1    0.0    0.0     0.0    0.0
 CAF:ifStmt4                                         ExprParser              <no location info>                          4440           0    0.0    0.0     0.0    0.0
  loxParenExpr                                       ExprParser              src/ExprParser.hs:(157,1)-(165,26)          4827           1    0.0    0.0     0.0    0.0
 CAF:ifStmt5                                         ExprParser              <no location info>                          4404           0    0.0    0.0     0.0    0.0
  loxParenExpr                                       ExprParser              src/ExprParser.hs:(157,1)-(165,26)          4924           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4925           1    0.0    0.0     0.0    0.0
 CAF:ifStmt7                                         ExprParser              <no location info>                          4439           0    0.0    0.0     0.0    0.0
  loxParenExpr                                       ExprParser              src/ExprParser.hs:(157,1)-(165,26)          4829           0    0.0    0.0     0.0    0.0
 CAF:ifStmt8                                         ExprParser              <no location info>                          4405           0    0.0    0.0     0.0    0.0
  loxParenExpr                                       ExprParser              src/ExprParser.hs:(157,1)-(165,26)          4830           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4831           1    0.0    0.0     0.0    0.0
 CAF:interpretProgram                                ExprInterpreter         src/ExprInterpreter.hs:294:1-16             4556           0    0.0    0.0     0.0    0.0
  interpretProgram                                   ExprInterpreter         src/ExprInterpreter.hs:(294,1)-(301,35)     5056           1    0.0    0.0     0.0    0.0
 CAF:keywordMapping11_rcob                           Scanner                 <no location info>                          4332           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping14_rcoe                           Scanner                 <no location info>                          4333           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping17_rcoh                           Scanner                 <no location info>                          4334           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping20_rcok                           Scanner                 <no location info>                          4335           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping23_rcon                           Scanner                 <no location info>                          4336           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping26_rcoq                           Scanner                 <no location info>                          4337           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping29_rcot                           Scanner                 <no location info>                          4338           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping2_rco2                            Scanner                 <no location info>                          4329           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping32_rcow                           Scanner                 <no location info>                          4339           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping35_rcoz                           Scanner                 <no location info>                          4340           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping38_rcoC                           Scanner                 <no location info>                          4341           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping41_rcoF                           Scanner                 <no location info>                          4342           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping44_rcoI                           Scanner                 <no location info>                          4343           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping47_rcoL                           Scanner                 <no location info>                          4344           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping5_rco5                            Scanner                 <no location info>                          4330           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping8_rco8                            Scanner                 <no location info>                          4331           0    0.0    0.0     0.0    0.0
 CAF:keywordMapping_r7TA                             Scanner                 src/Scanner.hs:135:1-14                     4345           0    0.0    0.0     0.0    0.0
  keywordMapping                                     Scanner                 src/Scanner.hs:(135,1)-(152,3)              4676           1    0.0    0.0     0.0    0.0
 CAF:la_rcqh                                         Scanner                 <no location info>                          4368           0    0.0    0.0     0.0    0.0
  scanDouble                                         Scanner                 src/Scanner.hs:(169,1)-(181,73)             4699           0    0.0    0.0     0.0    0.0
   scanDouble.la                                     Scanner                 src/Scanner.hs:171:7-62                     4700           1    0.0    0.0     0.0    0.0
 CAF:literal1                                        ExprParser              <no location info>                          4389           0    0.0    0.0     0.0    0.0
  literal                                            ExprParser              src/ExprParser.hs:(131,1)-(134,17)          4815           1    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4816           1    0.0    0.0     0.0    0.0
 CAF:logFuncAccentColorsL1                           RIO.Prelude.Logger      <no location info>                          4016           0    0.0    0.0     0.0    0.0
  defaultLogAccentColors                             RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:509:1-41          4617           1    0.0    0.0     0.0    0.0
 CAF:logFuncSecondaryColorL1                         RIO.Prelude.Logger      <no location info>                          4018           0    0.0    0.0     0.0    0.0
  defaultLogSecondaryColor                           RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:506:1-37          4614           1    0.0    0.0     0.0    0.0
 CAF:loxAssignment1                                  ExprParser              <no location info>                          4454           0    0.0    0.0     0.0    0.0
  loxAssignment                                      ExprParser              src/ExprParser.hs:(364,1)-(370,18)          5003           1    0.0    0.0     0.0    0.0
 CAF:loxAssignment2                                  ExprParser              <no location info>                          4416           0    0.0    0.0     0.0    0.0
  loxAssignment                                      ExprParser              src/ExprParser.hs:(364,1)-(370,18)          5005           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            5006           1    0.0    0.0     0.0    0.0
 CAF:loxBlock1                                       ExprParser              <no location info>                          4468           0    0.0    0.0     0.0    0.0
  loxBlock                                           ExprParser              src/ExprParser.hs:358:1-34                  4933           1    0.0    0.0     0.0    0.0
 CAF:loxBlock10                                      ExprParser              <no location info>                          4423           0    0.0    0.0     0.0    0.0
  loxBlock'                                          ExprParser              src/ExprParser.hs:(343,1)-(355,18)          4761           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4762           1    0.0    0.0     0.0    0.0
 CAF:loxBlock2                                       ExprParser              <no location info>                          4467           0    0.0    0.0     0.0    0.0
  loxBlock'                                          ExprParser              src/ExprParser.hs:(343,1)-(355,18)          4759           1    0.0    0.0     0.0    0.0
 CAF:loxBlock6                                       ExprParser              <no location info>                          4424           0    0.0    0.0     0.0    0.0
  loxBlock'                                          ExprParser              src/ExprParser.hs:(343,1)-(355,18)          4953           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4954           1    0.0    0.0     0.0    0.0
 CAF:loxBlock7                                       ExprParser              <no location info>                          4466           0    0.0    0.0     0.0    0.0
  loxProgram                                         ExprParser              src/ExprParser.hs:424:1-34                  4713           1    0.0    0.0     0.0    0.0
 CAF:loxBlock8                                       ExprParser              <no location info>                          4471           0    0.0    0.0     0.0    0.0
  loxDeclarations                                    ExprParser              src/ExprParser.hs:421:1-92                  4715           1    0.0    0.0     0.0    0.0
 CAF:loxBool1                                        ExprParser              <no location info>                          4393           0    0.0    0.0     0.0    0.0
  loxBool                                            ExprParser              src/ExprParser.hs:(143,1)-(147,17)          4819           1    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4820           1    0.0    0.0     0.0    0.0
 CAF:loxDeclStatment2                                ExprParser              <no location info>                          4470           0    0.0    0.0     0.0    0.0
  loxStatement                                       ExprParser              src/ExprParser.hs:339:1-158                 4771           1    0.0    0.0     0.0    0.0
 CAF:loxDeclaration1                                 ExprParser              <no location info>                          4456           0    0.0    0.0     0.0    0.0
  loxDeclaration                                     ExprParser              src/ExprParser.hs:(373,1)-(382,18)          4765           1    0.0    0.0     0.0    0.0
 CAF:loxDeclaration5                                 ExprParser              <no location info>                          4418           0    0.0    0.0     0.0    0.0
  loxDeclaration                                     ExprParser              src/ExprParser.hs:(373,1)-(382,18)          4767           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4768           1    0.0    0.0     0.0    0.0
 CAF:loxFuncDecl1                                    ExprParser              <no location info>                          4464           0    0.0    0.0     0.0    0.0
  loxFuncDecl                                        ExprParser              src/ExprParser.hs:(385,1)-(399,39)          4717           1    0.0    0.0     0.0    0.0
 CAF:loxFuncDecl5                                    ExprParser              <no location info>                          4420           0    0.0    0.0     0.0    0.0
  loxFuncDecl                                        ExprParser              src/ExprParser.hs:(385,1)-(399,39)          4719           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4720           1    0.0    0.0     0.0    0.0
 CAF:loxIdentifier1                                  ExprParser              <no location info>                          4391           0    0.0    0.0     0.0    0.0
  loxIdentifier                                      ExprParser              src/ExprParser.hs:(137,1)-(140,17)          4833           1    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4834           1    0.0    0.0     0.0    0.0
 CAF:loxLogicAnd                                     ExprParser              src/ExprParser.hs:265:1-11                  4436           0    0.0    0.0     0.0    0.0
  loxLogicAnd                                        ExprParser              src/ExprParser.hs:(265,1)-(269,18)          4784           1    0.0    0.0     0.0    0.0
   leftChainLogic                                    ExprParser              src/ExprParser.hs:(111,1)-(120,47)          4785           1    0.0    0.0     0.0    0.0
 CAF:loxLogicAnd1                                    ExprParser              <no location info>                          4410           0    0.0    0.0     0.0    0.0
  loxLogicAnd                                        ExprParser              src/ExprParser.hs:(265,1)-(269,18)          4907           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4908           1    0.0    0.0     0.0    0.0
 CAF:loxLogicOr                                      ExprParser              src/ExprParser.hs:258:1-10                  4437           0    0.0    0.0     0.0    0.0
  loxLogicOr                                         ExprParser              src/ExprParser.hs:(258,1)-(262,18)          4780           1    0.0    0.0     0.0    0.0
   leftChainLogic                                    ExprParser              src/ExprParser.hs:(111,1)-(120,47)          4781           1    0.0    0.0     0.0    0.0
 CAF:loxLogicOr1                                     ExprParser              <no location info>                          4409           0    0.0    0.0     0.0    0.0
  loxLogicOr                                         ExprParser              src/ExprParser.hs:(258,1)-(262,18)          4918           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4919           1    0.0    0.0     0.0    0.0
 CAF:loxNil1                                         ExprParser              <no location info>                          4395           0    0.0    0.0     0.0    0.0
  loxNil                                             ExprParser              src/ExprParser.hs:(151,1)-(154,17)          4823           1    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4824           1    0.0    0.0     0.0    0.0
 CAF:loxPrintStmt1                                   ExprParser              <no location info>                          4452           0    0.0    0.0     0.0    0.0
  loxPrintStmt                                       ExprParser              src/ExprParser.hs:(297,1)-(303,18)          4837           1    0.0    0.0     0.0    0.0
 CAF:loxPrintStmt3                                   ExprParser              <no location info>                          4415           0    0.0    0.0     0.0    0.0
  loxPrintStmt                                       ExprParser              src/ExprParser.hs:(297,1)-(303,18)          4839           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4840           1    0.0    0.0     0.0    0.0
 CAF:loxReturn1                                      ExprParser              <no location info>                          4458           0    0.0    0.0     0.0    0.0
  loxReturn                                          ExprParser              src/ExprParser.hs:(402,1)-(410,18)          4936           1    0.0    0.0     0.0    0.0
 CAF:loxReturn4                                      ExprParser              <no location info>                          4417           0    0.0    0.0     0.0    0.0
  loxReturn                                          ExprParser              src/ExprParser.hs:(402,1)-(410,18)          4938           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4939           1    0.0    0.0     0.0    0.0
 CAF:lvl24_rcp8                                      Scanner                 <no location info>                          4353           0    0.0    0.0     0.0    0.0
 CAF:lvl64_rq8I                                      RIO.Prelude.Logger      <no location info>                          4081           0    0.0    0.0     0.0    0.0
 CAF:lvl71_rq8Q                                      RIO.Prelude.Logger      <no location info>                          4086           0    0.0    0.0     0.0    0.0
  newLogFunc                                         RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(407,1)-(424,12)  4619           0    0.0    0.0     0.0    0.0
   newMVar                                           UnliftIO.MVar           src/UnliftIO/MVar.hs:40:1-28                4620           1    0.0    0.0     0.0    0.0
 CAF:lvl74_rcqk                                      Scanner                 <no location info>                          4369           0    0.0    0.0     0.0    0.0
 CAF:lvl77_rcqn                                      Scanner                 <no location info>                          4370           0    0.0    0.0     0.0    0.0
 CAF:lvl80_rcqq                                      Scanner                 <no location info>                          4371           0    0.0    0.0     0.0    0.0
 CAF:lvl83_rcqt                                      Scanner                 <no location info>                          4372           0    0.0    0.0     0.0    0.0
 CAF:m10_rcqf                                        Scanner                 <no location info>                          4366           0    0.0    0.0     0.0    0.0
  scanSingleCharToken                                Scanner                 src/Scanner.hs:(109,1)-(115,44)             4651           0    0.0    0.0     0.0    0.0
   scanSingleCharToken.build                         Scanner                 src/Scanner.hs:115:5-44                     4653          15    0.0    0.0     0.0    0.0
   charMapping                                       Scanner                 src/Scanner.hs:(90,1)-(106,3)               4652           1    0.0    0.0     0.0    0.0
 CAF:m11_rcqz                                        Scanner                 <no location info>                          4373           0    0.0    0.0     0.0    0.0
  scanDoubleToken                                    Scanner                 src/Scanner.hs:(126,1)-(132,46)             4645           0    0.0    0.0     0.0    0.0
   scanDoubleToken.build                             Scanner                 src/Scanner.hs:132:5-46                     4647           4    0.0    0.0     0.0    0.0
   doubleCharMapping                                 Scanner                 src/Scanner.hs:(118,1)-(123,3)              4646           1    0.0    0.0     0.0    0.0
 CAF:m12_rcqK                                        Scanner                 <no location info>                          4382           0    0.0    0.0     0.0    0.0
  scanQuotedString                                   Scanner                 src/Scanner.hs:(196,1)-(199,81)             4657           0    0.0    0.0     0.0    0.0
 CAF:m2_rcnA                                         Scanner                 <no location info>                          4284           0    0.0    0.0     0.0    0.0
 CAF:m3_rcpf                                         Scanner                 <no location info>                          4357           0    0.0    0.0     0.0    0.0
  var                                                Scanner                 src/Scanner.hs:(203,1)-(209,70)             4665           0    0.0    0.0     0.0    0.0
   var.firstChar                                     Scanner                 src/Scanner.hs:208:5-54                     4666           1    0.0    0.0     0.0    0.0
 CAF:m9_rcpu                                         Scanner                 <no location info>                          4364           0    0.0    0.0     0.0    0.0
  whitespaceToken                                    Scanner                 src/Scanner.hs:(163,1)-(166,59)             4704           0    0.0    0.0     0.0    0.0
 CAF:main                                            Main                    app/scanner.hs:29:1-4                       4565           0    0.0    0.0     0.0    0.0
  main                                               Main                    app/scanner.hs:(29,1)-(37,24)               4596           1    0.0    0.0     0.0    0.0
   runSimpleApp                                      RIO.Prelude.Simple      src/RIO/Prelude/Simple.hs:(57,1)-(62,22)    4597           1    0.0    0.0     0.0    0.0
 CAF:main1                                           Main                    <no location info>                          4564           0    0.0    0.0     0.0    0.0
  main                                               Main                    app/scanner.hs:(29,1)-(37,24)               4628           0    0.0    0.0     0.0    0.0
 CAF:main10                                          Main                    <no location info>                          4559           0    0.0    0.0     0.0    0.0
  main                                               Main                    app/scanner.hs:(29,1)-(37,24)               4630           0    0.0    0.0     0.0    0.0
 CAF:nonFirstChar1_rcpd                              Scanner                 <no location info>                          4356           0    0.0    0.0     0.0    0.0
  var                                                Scanner                 src/Scanner.hs:(203,1)-(209,70)             4669           0    0.0    0.0     0.0    0.0
   var.nonFirstChar                                  Scanner                 src/Scanner.hs:209:5-70                     4670           1    0.0    0.0     0.0    0.0
 CAF:number1                                         ExprParser              <no location info>                          4387           0    0.0    0.0     0.0    0.0
  number                                             ExprParser              src/ExprParser.hs:(125,1)-(128,17)          4811           1    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4812           1    0.0    0.0     0.0    0.0
 CAF:parameters_rpzJ                                 ExprParser              <no location info>                          4403           0    0.0    0.0     0.0    0.0
  loxFuncDecl                                        ExprParser              src/ExprParser.hs:(385,1)-(399,39)          4738           0    0.0    0.0     0.0    0.0
   loxFuncDecl.parameters                            ExprParser              src/ExprParser.hs:399:5-39                  4739           1    0.0    0.0     0.0    0.0
 CAF:runSimpleApp1                                   RIO.Prelude.Simple      <no location info>                          4192           0    0.0    0.0     0.0    0.0
 CAF:scanComment_rcpp                                Scanner                 <no location info>                          4360           0    0.0    0.0     0.0    0.0
  scanComment                                        Scanner                 src/Scanner.hs:(223,1)-(228,75)             4641           1    0.0    0.0     0.0    0.0
 CAF:scanDoubleToken_rcqA                            Scanner                 <no location info>                          4374           0    0.0    0.0     0.0    0.0
  scanDoubleToken                                    Scanner                 src/Scanner.hs:(126,1)-(132,46)             4643           1    0.0    0.0     0.0    0.0
 CAF:scanDouble_rcqJ                                 Scanner                 <no location info>                          4381           0    0.0    0.0     0.0    0.0
  scanDouble                                         Scanner                 src/Scanner.hs:(169,1)-(181,73)             4658           1    0.0    0.0     0.0    0.0
 CAF:scanQuotedString_rcqO                           Scanner                 <no location info>                          4383           0    0.0    0.0     0.0    0.0
  scanQuotedString                                   Scanner                 src/Scanner.hs:(196,1)-(199,81)             4655           1    0.0    0.0     0.0    0.0
 CAF:scanSingleCharToken_rcqg                        Scanner                 <no location info>                          4367           0    0.0    0.0     0.0    0.0
  scanSingleCharToken                                Scanner                 src/Scanner.hs:(109,1)-(115,44)             4649           1    0.0    0.0     0.0    0.0
 CAF:scanner1                                        Scanner                 <no location info>                          4385           0    0.0    0.0     0.0    0.0
  scanner                                            Scanner                 src/Scanner.hs:240:1-42                     4637           1    0.0    0.0     0.0    0.0
 CAF:scanner9                                        Scanner                 <no location info>                          4384           0    0.0    0.0     0.0    0.0
  scanToken                                          Scanner                 src/Scanner.hs:(231,1)-(237,25)             4639           1    0.0    0.0     0.0    0.0
 CAF:semi1                                           ExprParser              <no location info>                          4397           0    0.0    0.0     0.0    0.0
  semi                                               ExprParser              src/ExprParser.hs:(273,1)-(277,18)          4944           1    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4945           1    0.0    0.0     0.0    0.0
 CAF:term                                            ExprParser              src/ExprParser.hs:214:1-4                   4433           0    0.0    0.0     0.0    0.0
  term                                               ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4794           1    0.0    0.0     0.0    0.0
   leftChain                                         ExprParser              src/ExprParser.hs:(99,1)-(108,47)           4795           1    0.0    0.0     0.0    0.0
 CAF:term1                                           ExprParser              <no location info>                          4413           0    0.0    0.0     0.0    0.0
  term                                               ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4887           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4888           1    0.0    0.0     0.0    0.0
 CAF:unary'1                                         ExprParser              <no location info>                          4430           0    0.0    0.0     0.0    0.0
  unary'                                             ExprParser              src/ExprParser.hs:(171,1)-(175,17)          4802           1    0.0    0.0     0.0    0.0
 CAF:unary'3                                         ExprParser              <no location info>                          4406           0    0.0    0.0     0.0    0.0
  unary'                                             ExprParser              src/ExprParser.hs:(171,1)-(175,17)          4804           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4805           1    0.0    0.0     0.0    0.0
 CAF:var_rcpg                                        Scanner                 <no location info>                          4358           0    0.0    0.0     0.0    0.0
  var                                                Scanner                 src/Scanner.hs:(203,1)-(209,70)             4663           1    0.0    0.0     0.0    0.0
 CAF:whileStmt1                                      ExprParser              <no location info>                          4469           0    0.0    0.0     0.0    0.0
  whileStmt                                          ExprParser              src/ExprParser.hs:(327,1)-(335,18)          4927           1    0.0    0.0     0.0    0.0
 CAF:whileStmt5                                      ExprParser              <no location info>                          4419           0    0.0    0.0     0.0    0.0
  whileStmt                                          ExprParser              src/ExprParser.hs:(327,1)-(335,18)          4929           0    0.0    0.0     0.0    0.0
   satisfyT                                          ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4930           1    0.0    0.0     0.0    0.0
 CAF:whitespaceToken_rcpv                            Scanner                 <no location info>                          4365           0    0.0    0.0     0.0    0.0
  whitespaceToken                                    Scanner                 src/Scanner.hs:(163,1)-(166,59)             4702           1    0.0    0.0     0.0    0.0
 CAF:whitespace_rcpb                                 Scanner                 <no location info>                          4355           0    0.0    0.0     0.0    0.0
  whitespace                                         Scanner                 src/Scanner.hs:81:1-40                      4674           1    0.0    0.0     0.0    0.0
 main                                                Main                    app/scanner.hs:(29,1)-(37,24)               4598           0    0.0    0.0   100.0  100.0
  runSimpleApp                                       RIO.Prelude.Simple      src/RIO/Prelude/Simple.hs:(57,1)-(62,22)    4599           0    0.0    0.0   100.0  100.0
   logOptionsHandle                                  RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(355,1)-(386,5)   4600           1    0.0    0.0     0.0    0.0
    canUseUtf8                                       RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(305,1)-(307,60)  4602           1    0.0    0.0     0.0    0.0
     canUseUtf8.\                                    RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(305,68)-(307,60) 4603           1    0.0    0.0     0.0    0.0
    hIsTerminalDevice                                UnliftIO.IO             src/UnliftIO/IO.hs:142:1-49                 4601           1    0.0    0.0     0.0    0.0
   withLogFunc                                       RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(445,1)-(448,29)  4604           1    0.0    0.0   100.0  100.0
    withRunInIO                                      Control.Monad.IO.Unlift src/Control/Monad/IO/Unlift.hs:63:3-30      4605           2    0.0    0.0   100.0  100.0
     withLogFunc.\                                   RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(445,51)-(448,29) 4606           1    0.0    0.0   100.0  100.0
      bracket                                        UnliftIO.Exception      src/UnliftIO/Exception.hs:(345,1)-(360,14)  4607           1    0.0    0.0   100.0  100.0
       bracket.\                                     UnliftIO.Exception      src/UnliftIO/Exception.hs:(345,52)-(360,14) 4608           1    0.0    0.0   100.0  100.0
        bracket.\.\                                  UnliftIO.Exception      src/UnliftIO/Exception.hs:(345,79)-(360,14) 4609           1    0.0    0.0   100.0  100.0
         runSimpleApp.\                              RIO.Prelude.Simple      src/RIO/Prelude/Simple.hs:(60,27)-(62,22)   4622           1    0.0    0.0   100.0  100.0
          mkSimpleApp                                RIO.Prelude.Simple      src/RIO/Prelude/Simple.hs:(41,1)-(43,75)    4623           1    0.0    0.0     0.0    0.0
           mkDefaultProcessContext                   RIO.Process             src/RIO/Process.hs:(319,1)-(323,48)         4624           1    0.0    0.0     0.0    0.0
            mkProcessContext                         RIO.Process             src/RIO/Process.hs:(273,1)-(295,76)         4625           1    0.0    0.0     0.0    0.0
             newIORef                                UnliftIO.IORef          src/UnliftIO/IORef.hs:26:1-30               4626           1    0.0    0.0     0.0    0.0
          readFile                                   RIO.ByteString          src/RIO/ByteString.hs:53:1-30               4633           1    0.0    0.0     0.0    0.0
          runRIO                                     RIO.Prelude.RIO         src/RIO/Prelude/RIO.hs:52:1-45              4627           1    0.0    0.0     0.0    0.0
          runScript                                  ExprInterpreter         src/ExprInterpreter.hs:(304,1)-(322,15)     4635           1    0.0    0.0   100.0  100.0
           initEnv                                   ExprInterpreter         src/ExprInterpreter.hs:57:1-50              5067           1    0.0    0.0     0.0    0.0
           runScript.ast                             ExprInterpreter         src/ExprInterpreter.hs:308:11-69            4712           1    0.0    0.0     0.0    0.0
            runScript.filter_comments                ExprInterpreter         src/ExprInterpreter.hs:(320,5)-(322,15)     4722          47    0.0    0.0     0.0    0.0
             tokinfo_type                            Scanner                 src/Scanner.hs:66:5-16                      4723          47    0.0    0.0     0.0    0.0
            loxProgram                               ExprParser              src/ExprParser.hs:424:1-34                  4714           0    0.0    0.0     0.0    0.0
             loxDeclarations                         ExprParser              src/ExprParser.hs:421:1-92                  4716           0    0.0    0.0     0.0    0.0
              loxFuncDecl                            ExprParser              src/ExprParser.hs:(385,1)-(399,39)          4718           0    0.0    0.0     0.0    0.0
               loxFuncDecl.parameters                ExprParser              src/ExprParser.hs:399:5-39                  4740           0    0.0    0.0     0.0    0.0
                identifier                           ExprParser              src/ExprParser.hs:(413,1)-(417,18)          4741           0    0.0    0.0     0.0    0.0
                 satisfyT                            ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4742           0    0.0    0.0     0.0    0.0
                  satisfyT.match                     ExprParser              src/ExprParser.hs:94:5-17                   4743           2    0.0    0.0     0.0    0.0
                   comma.f                           ExprParser              src/ExprParser.hs:(282,5)-(284,18)          4751           1    0.0    0.0     0.0    0.0
                    tokinfo_type                     Scanner                 src/Scanner.hs:66:5-16                      4752           1    0.0    0.0     0.0    0.0
                   identifier.fi                     ExprParser              src/ExprParser.hs:(415,5)-(417,18)          4744           1    0.0    0.0     0.0    0.0
                    tokinfo_type                     Scanner                 src/Scanner.hs:66:5-16                      4745           1    0.0    0.0     0.0    0.0
                  satisfyT.updateTokPos              ExprParser              src/ExprParser.hs:(92,5)-(93,31)            4746           1    0.0    0.0     0.0    0.0
                   tok_position                      Scanner                 src/Scanner.hs:69:5-16                      4747           1    0.0    0.0     0.0    0.0
                  comma                              ExprParser              src/ExprParser.hs:(280,1)-(284,18)          4750           0    0.0    0.0     0.0    0.0
               satisfyT                              ExprParser              src/ExprParser.hs:(89,1)-(94,17)            4721           0    0.0    0.0     0.0    0.0
                satisfyT.match                       ExprParser              src/ExprParser.hs:94:5-17                   4724         298    0.0    0.0     0.0    0.0
                 number.f                            ExprParser              src/ExprParser.hs:(127,5)-(128,17)          4814          21    0.0    0.0     0.0    0.0
                 unary'.f                            ExprParser              src/ExprParser.hs:(173,5)-(175,17)          4806          21    0.0    0.0     0.0    0.0
                 loxParenExpr.parenOpen              ExprParser              src/ExprParser.hs:(161,5)-(162,25)          4832          18    0.0    0.0     0.0    0.0
                 assignment.identifier               ExprParser              src/ExprParser.hs:(251,5)-(252,26)          4779          17    0.0    0.0     0.0    0.0
                 literal.f                           ExprParser              src/ExprParser.hs:(133,5)-(134,17)          4818          17    0.0    0.0     0.0    0.0
                 loxBool.f                           ExprParser              src/ExprParser.hs:(145,5)-(147,17)          4822          17    0.0    0.0     0.0    0.0
                 loxIdentifier.f                     ExprParser              src/ExprParser.hs:(139,5)-(140,17)          4836          17    0.0    0.0     0.0    0.0
                 loxNil.f                            ExprParser              src/ExprParser.hs:(153,5)-(154,17)          4826          17    0.0    0.0     0.0    0.0
                 openParen                           ExprParser              src/ExprParser.hs:(287,1)-(289,14)          4736          17    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4737          17    0.0    0.0     0.0    0.0
                 factor.f                            ExprParser              src/ExprParser.hs:(208,5)-(211,18)          4882          13    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4883          13    0.0    0.0     0.0    0.0
                 term.f                              ExprParser              src/ExprParser.hs:(216,5)-(219,18)          4890          13    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4891          13    0.0    0.0     0.0    0.0
                 comparison.f                        ExprParser              src/ExprParser.hs:(225,5)-(230,18)          4896          10    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4897          10    0.0    0.0     0.0    0.0
                 equality.f                          ExprParser              src/ExprParser.hs:(235,5)-(238,18)          4902           9    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4903           9    0.0    0.0     0.0    0.0
                 loxFuncDecl.func_keyword            ExprParser              src/ExprParser.hs:(394,5)-(396,18)          4725           9    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4726           9    0.0    0.0     0.0    0.0
                 loxLogicAnd.f                       ExprParser              src/ExprParser.hs:(267,5)-(269,18)          4910           9    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4911           9    0.0    0.0     0.0    0.0
                 loxLogicOr.f                        ExprParser              src/ExprParser.hs:(260,5)-(262,18)          4920           9    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4921           9    0.0    0.0     0.0    0.0
                 assignment.equals                   ExprParser              src/ExprParser.hs:(247,5)-(249,18)          4852           8    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4853           8    0.0    0.0     0.0    0.0
                 loxDeclaration.f                    ExprParser              src/ExprParser.hs:(380,5)-(382,18)          4769           8    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4770           8    0.0    0.0     0.0    0.0
                 loxPrintStmt.f                      ExprParser              src/ExprParser.hs:(301,5)-(303,18)          4841           8    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4842           8    0.0    0.0     0.0    0.0
                 ifStmt.if_keyword                   ExprParser              src/ExprParser.hs:(313,5)-(315,18)          4847           6    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4848           6    0.0    0.0     0.0    0.0
                 loxBlock'.left_brace                ExprParser              src/ExprParser.hs:(349,5)-(351,18)          4763           6    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4764           6    0.0    0.0     0.0    0.0
                 semi.f                              ExprParser              src/ExprParser.hs:(275,5)-(277,18)          4947           5    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4948           5    0.0    0.0     0.0    0.0
                 whileStmt.while_keyword             ExprParser              src/ExprParser.hs:(333,5)-(335,18)          4931           5    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4932           5    0.0    0.0     0.0    0.0
                 closeParen                          ExprParser              src/ExprParser.hs:(292,1)-(294,14)          4755           4    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4756           4    0.0    0.0     0.0    0.0
                 loxReturn.return_keyword            ExprParser              src/ExprParser.hs:(408,5)-(410,18)          4940           4    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4941           4    0.0    0.0     0.0    0.0
                 comma.f                             ExprParser              src/ExprParser.hs:(282,5)-(284,18)          4975           3    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4976           3    0.0    0.0     0.0    0.0
                 identifier.fi                       ExprParser              src/ExprParser.hs:(415,5)-(417,18)          4732           2    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4733           2    0.0    0.0     0.0    0.0
                 loxBlock'.right_brace               ExprParser              src/ExprParser.hs:(353,5)-(355,18)          4955           2    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4956           2    0.0    0.0     0.0    0.0
                 ifStmt.else_keyword                 ExprParser              src/ExprParser.hs:(317,5)-(319,18)          4965           1    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      4966           1    0.0    0.0     0.0    0.0
                 loxAssignment.f                     ExprParser              src/ExprParser.hs:(368,5)-(370,18)          5007           1    0.0    0.0     0.0    0.0
                  tokinfo_type                       Scanner                 src/Scanner.hs:66:5-16                      5008           1    0.0    0.0     0.0    0.0
                 loxParenExpr.parenClose             ExprParser              src/ExprParser.hs:(164,5)-(165,26)          4926           1    0.0    0.0     0.0    0.0
                satisfyT.updateTokPos                ExprParser              src/ExprParser.hs:(92,5)-(93,31)            4727          54    0.0    0.0     0.0    0.0
                 tok_position                        Scanner                 src/Scanner.hs:69:5-16                      4728          53    0.0    0.0     0.0    0.0
                identifier                           ExprParser              src/ExprParser.hs:(413,1)-(417,18)          4731           0    0.0    0.0     0.0    0.0
                loxBlock'                            ExprParser              src/ExprParser.hs:(343,1)-(355,18)          4760           0    0.0    0.0     0.0    0.0
                loxDeclaration                       ExprParser              src/ExprParser.hs:(373,1)-(382,18)          4766           0    0.0    0.0     0.0    0.0
                 identifier                          ExprParser              src/ExprParser.hs:(413,1)-(417,18)          5002           0    0.0    0.0     0.0    0.0
                 loxAssignment                       ExprParser              src/ExprParser.hs:(364,1)-(370,18)          5004           0    0.0    0.0     0.0    0.0
                  loxExpr                            ExprParser              src/ExprParser.hs:255:1-39                  5009           0    0.0    0.0     0.0    0.0
                   assignment                        ExprParser              src/ExprParser.hs:(241,1)-(252,26)          5010           0    0.0    0.0     0.0    0.0
                   loxLogicOr                        ExprParser              src/ExprParser.hs:(258,1)-(262,18)          5011           0    0.0    0.0     0.0    0.0
                    leftChainLogic                   ExprParser              src/ExprParser.hs:(111,1)-(120,47)          5012           0    0.0    0.0     0.0    0.0
                     leftChainLogic.maybeAddSuffix   ExprParser              src/ExprParser.hs:120:5-47                  5036           2    0.0    0.0     0.0    0.0
                      leftChainLogic.addSuffix       ExprParser              src/ExprParser.hs:(115,5)-(118,40)          5037           2    0.0    0.0     0.0    0.0
                       loxLogicAnd                   ExprParser              src/ExprParser.hs:(265,1)-(269,18)          5038           0    0.0    0.0     0.0    0.0
                      equality                       ExprParser              src/ExprParser.hs:(233,1)-(238,18)          5039           0    0.0    0.0     0.0    0.0
                       leftChain                     ExprParser              src/ExprParser.hs:(99,1)-(108,47)           5040           0    0.0    0.0     0.0    0.0
                        leftChain.maybeAddSuffix     ExprParser              src/ExprParser.hs:108:5-47                  5041           0    0.0    0.0     0.0    0.0
                         unary                       ExprParser              src/ExprParser.hs:179:1-27                  5042           0    0.0    0.0     0.0    0.0
                          call                       ExprParser              src/ExprParser.hs:(182,1)-(192,52)          5043           0    0.0    0.0     0.0    0.0
                           loxStatement              ExprParser              src/ExprParser.hs:339:1-158                 5045           0    0.0    0.0     0.0    0.0
                           semi                      ExprParser              src/ExprParser.hs:(273,1)-(277,18)          5044           0    0.0    0.0     0.0    0.0
                     equality                        ExprParser              src/ExprParser.hs:(233,1)-(238,18)          5014           0    0.0    0.0     0.0    0.0
                      leftChain                      ExprParser              src/ExprParser.hs:(99,1)-(108,47)           5015           0    0.0    0.0     0.0    0.0
                       leftChain.maybeAddSuffix      ExprParser              src/ExprParser.hs:108:5-47                  5026           4    0.0    0.0     0.0    0.0
                        leftChain.addSuffix          ExprParser              src/ExprParser.hs:(103,5)-(106,39)          5027           4    0.0    0.0     0.0    0.0
                         comparison                  ExprParser              src/ExprParser.hs:(223,1)-(230,18)          5034           0    0.0    0.0     0.0    0.0
                         factor                      ExprParser              src/ExprParser.hs:(206,1)-(211,18)          5028           0    0.0    0.0     0.0    0.0
                         term                        ExprParser              src/ExprParser.hs:(214,1)-(219,18)          5032           0    0.0    0.0     0.0    0.0
                        unary                        ExprParser              src/ExprParser.hs:179:1-27                  5029           0    0.0    0.0     0.0    0.0
                         call                        ExprParser              src/ExprParser.hs:(182,1)-(192,52)          5030           0    0.0    0.0     0.0    0.0
                          comparison                 ExprParser              src/ExprParser.hs:(223,1)-(230,18)          5033           0    0.0    0.0     0.0    0.0
                          loxLogicAnd                ExprParser              src/ExprParser.hs:(265,1)-(269,18)          5035           0    0.0    0.0     0.0    0.0
                          term                       ExprParser              src/ExprParser.hs:(214,1)-(219,18)          5031           0    0.0    0.0     0.0    0.0
                       comparison                    ExprParser              src/ExprParser.hs:(223,1)-(230,18)          5016           0    0.0    0.0     0.0    0.0
                       factor                        ExprParser              src/ExprParser.hs:(206,1)-(211,18)          5018           0    0.0    0.0     0.0    0.0
                       term                          ExprParser              src/ExprParser.hs:(214,1)-(219,18)          5017           0    0.0    0.0     0.0    0.0
                       unary                         ExprParser              src/ExprParser.hs:179:1-27                  5019           0    0.0    0.0     0.0    0.0
                        call                         ExprParser              src/ExprParser.hs:(182,1)-(192,52)          5021           0    0.0    0.0     0.0    0.0
                         factor                      ExprParser              src/ExprParser.hs:(206,1)-(211,18)          5025           0    0.0    0.0     0.0    0.0
                         funcCall                    ExprParser              src/ExprParser.hs:(195,1)-(199,31)          5024           0    0.0    0.0     0.0    0.0
                         loxPrimary                  ExprParser              src/ExprParser.hs:168:1-89                  5022           0    0.0    0.0     0.0    0.0
                          ifStmt                     ExprParser              src/ExprParser.hs:(306,1)-(323,18)          5046           0    0.0    0.0     0.0    0.0
                           loxBlock'                 ExprParser              src/ExprParser.hs:(343,1)-(355,18)          5047           0    0.0    0.0     0.0    0.0
                            loxStatement             ExprParser              src/ExprParser.hs:339:1-158                 5048           0    0.0    0.0     0.0    0.0
                          number                     ExprParser              src/ExprParser.hs:(125,1)-(128,17)          5023           0    0.0    0.0     0.0    0.0
                        unary'                       ExprParser              src/ExprParser.hs:(171,1)-(175,17)          5020           0    0.0    0.0     0.0    0.0
                     loxLogicAnd                     ExprParser              src/ExprParser.hs:(265,1)-(269,18)          5013           0    0.0    0.0     0.0    0.0
                loxFuncDecl.parameters               ExprParser              src/ExprParser.hs:399:5-39                  4757           0    0.0    0.0     0.0    0.0
                 identifier                          ExprParser              src/ExprParser.hs:(413,1)-(417,18)          4758           0    0.0    0.0     0.0    0.0
                loxStatement                         ExprParser              src/ExprParser.hs:339:1-158                 4772           0    0.0    0.0     0.0    0.0
                 loxExpr                             ExprParser              src/ExprParser.hs:255:1-39                  4774           0    0.0    0.0     0.0    0.0
                  assignment                         ExprParser              src/ExprParser.hs:(241,1)-(252,26)          4776           0    0.0    0.0     0.0    0.0
                   loxLogicOr                        ExprParser              src/ExprParser.hs:(258,1)-(262,18)          4854           0    0.0    0.0     0.0    0.0
                    leftChainLogic                   ExprParser              src/ExprParser.hs:(111,1)-(120,47)          4855           0    0.0    0.0     0.0    0.0
                     leftChainLogic.maybeAddSuffix   ExprParser              src/ExprParser.hs:120:5-47                  4905          16    0.0    0.0     0.0    0.0
                      leftChainLogic.addSuffix       ExprParser              src/ExprParser.hs:(115,5)-(118,40)          4906          16    0.0    0.0     0.0    0.0
                       loxLogicAnd                   ExprParser              src/ExprParser.hs:(265,1)-(269,18)          4909           0    0.0    0.0     0.0    0.0
                      equality                       ExprParser              src/ExprParser.hs:(233,1)-(238,18)          4912           0    0.0    0.0     0.0    0.0
                       leftChain                     ExprParser              src/ExprParser.hs:(99,1)-(108,47)           4913           0    0.0    0.0     0.0    0.0
                        leftChain.maybeAddSuffix     ExprParser              src/ExprParser.hs:108:5-47                  4914          10    0.0    0.0     0.0    0.0
                         leftChain.addSuffix         ExprParser              src/ExprParser.hs:(103,5)-(106,39)          4980          10    0.0    0.0     0.0    0.0
                          comparison                 ExprParser              src/ExprParser.hs:(223,1)-(230,18)          4998           0    0.0    0.0     0.0    0.0
                          factor                     ExprParser              src/ExprParser.hs:(206,1)-(211,18)          4981           0    0.0    0.0     0.0    0.0
                          term                       ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4983           0    0.0    0.0     0.0    0.0
                         loxLogicAnd                 ExprParser              src/ExprParser.hs:(265,1)-(269,18)          4999           0    0.0    0.0     0.0    0.0
                         unary                       ExprParser              src/ExprParser.hs:179:1-27                  4915           0    0.0    0.0     0.0    0.0
                          call                       ExprParser              src/ExprParser.hs:(182,1)-(192,52)          4916           0    0.0    0.0     0.0    0.0
                           call.step                 ExprParser              src/ExprParser.hs:189:5-76                  5087           1    0.0    0.0     0.0    0.0
                            call.getLoxSourcePos     ExprParser              src/ExprParser.hs:(190,5)-(192,52)          5088           1    0.0    0.0     0.0    0.0
                             call.getLoxSourcePos.sc ExprParser              src/ExprParser.hs:190:37-63                 5089           1    0.0    0.0     0.0    0.0
                              tok_position           Scanner                 src/Scanner.hs:69:5-16                      5090           1    0.0    0.0     0.0    0.0
                           factor                    ExprParser              src/ExprParser.hs:(206,1)-(211,18)          4995           0    0.0    0.0     0.0    0.0
                           funcCall                  ExprParser              src/ExprParser.hs:(195,1)-(199,31)          4992           0    0.0    0.0     0.0    0.0
                            loxArguments             ExprParser              src/ExprParser.hs:202:1-34                  4993           0    0.0    0.0     0.0    0.0
                             comma                   ExprParser              src/ExprParser.hs:(280,1)-(284,18)          4994           0    0.0    0.0     0.0    0.0
                           leftChain.addSuffix       ExprParser              src/ExprParser.hs:(103,5)-(106,39)          4917           0    0.0    0.0     0.0    0.0
                            term                     ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4996           0    0.0    0.0     0.0    0.0
                        comparison                   ExprParser              src/ExprParser.hs:(223,1)-(230,18)          4997           0    0.0    0.0     0.0    0.0
                        factor                       ExprParser              src/ExprParser.hs:(206,1)-(211,18)          4979           0    0.0    0.0     0.0    0.0
                        term                         ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4982           0    0.0    0.0     0.0    0.0
                        unary                        ExprParser              src/ExprParser.hs:179:1-27                  4970           0    0.0    0.0     0.0    0.0
                         call                        ExprParser              src/ExprParser.hs:(182,1)-(192,52)          4971           0    0.0    0.0     0.0    0.0
                          call.step                  ExprParser              src/ExprParser.hs:189:5-76                  5072           2    0.0    0.0     0.0    0.0
                           call.getLoxSourcePos      ExprParser              src/ExprParser.hs:(190,5)-(192,52)          5073           2    0.0    0.0     0.0    0.0
                            call.getLoxSourcePos.sc  ExprParser              src/ExprParser.hs:190:37-63                 5074           2    0.0    0.0     0.0    0.0
                             tok_position            Scanner                 src/Scanner.hs:69:5-16                      5075           2    0.0    0.0     0.0    0.0
                          funcCall                   ExprParser              src/ExprParser.hs:(195,1)-(199,31)          4972           0    0.0    0.0     0.0    0.0
                           loxArguments              ExprParser              src/ExprParser.hs:202:1-34                  4973           0    0.0    0.0     0.0    0.0
                            comma                    ExprParser              src/ExprParser.hs:(280,1)-(284,18)          4974           0    0.0    0.0     0.0    0.0
                          loxPrimary                 ExprParser              src/ExprParser.hs:168:1-89                  4985           0    0.0    0.0     0.0    0.0
                           literal                   ExprParser              src/ExprParser.hs:(131,1)-(134,17)          4987           0    0.0    0.0     0.0    0.0
                           loxBool                   ExprParser              src/ExprParser.hs:(143,1)-(147,17)          4988           0    0.0    0.0     0.0    0.0
                           loxIdentifier             ExprParser              src/ExprParser.hs:(137,1)-(140,17)          4991           0    0.0    0.0     0.0    0.0
                           loxNil                    ExprParser              src/ExprParser.hs:(151,1)-(154,17)          4989           0    0.0    0.0     0.0    0.0
                           loxParenExpr              ExprParser              src/ExprParser.hs:(157,1)-(165,26)          4990           0    0.0    0.0     0.0    0.0
                           number                    ExprParser              src/ExprParser.hs:(125,1)-(128,17)          4986           0    0.0    0.0     0.0    0.0
                         unary'                      ExprParser              src/ExprParser.hs:(171,1)-(175,17)          4984           0    0.0    0.0     0.0    0.0
                     equality                        ExprParser              src/ExprParser.hs:(233,1)-(238,18)          4857           0    0.0    0.0     0.0    0.0
                      leftChain                      ExprParser              src/ExprParser.hs:(99,1)-(108,47)           4858           0    0.0    0.0     0.0    0.0
                       leftChain.maybeAddSuffix      ExprParser              src/ExprParser.hs:108:5-47                  4877          31    0.0    0.0     0.0    0.0
                        leftChain.addSuffix          ExprParser              src/ExprParser.hs:(103,5)-(106,39)          4878          31    0.0    0.0     0.0    0.0
                         comparison                  ExprParser              src/ExprParser.hs:(223,1)-(230,18)          4895           0    0.0    0.0     0.0    0.0
                         factor                      ExprParser              src/ExprParser.hs:(206,1)-(211,18)          4881           0    0.0    0.0     0.0    0.0
                         term                        ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4889           0    0.0    0.0     0.0    0.0
                        unary                        ExprParser              src/ExprParser.hs:179:1-27                  4884           0    0.0    0.0     0.0    0.0
                         call                        ExprParser              src/ExprParser.hs:(182,1)-(192,52)          4885           0    0.0    0.0     0.0    0.0
                          comparison                 ExprParser              src/ExprParser.hs:(223,1)-(230,18)          4892           0    0.0    0.0     0.0    0.0
                          leftChain.addSuffix        ExprParser              src/ExprParser.hs:(103,5)-(106,39)          4898           0    0.0    0.0     0.0    0.0
                           comparison                ExprParser              src/ExprParser.hs:(223,1)-(230,18)          4899           0    0.0    0.0     0.0    0.0
                           loxLogicAnd               ExprParser              src/ExprParser.hs:(265,1)-(269,18)          4904           0    0.0    0.0     0.0    0.0
                           term                      ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4969           0    0.0    0.0     0.0    0.0
                          loxLogicAnd                ExprParser              src/ExprParser.hs:(265,1)-(269,18)          4942           0    0.0    0.0     0.0    0.0
                          term                       ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4886           0    0.0    0.0     0.0    0.0
                       comparison                    ExprParser              src/ExprParser.hs:(223,1)-(230,18)          4859           0    0.0    0.0     0.0    0.0
                       factor                        ExprParser              src/ExprParser.hs:(206,1)-(211,18)          4861           0    0.0    0.0     0.0    0.0
                       term                          ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4860           0    0.0    0.0     0.0    0.0
                       unary                         ExprParser              src/ExprParser.hs:179:1-27                  4862           0    0.0    0.0     0.0    0.0
                        call                         ExprParser              src/ExprParser.hs:(182,1)-(192,52)          4864           0    0.0    0.0     0.0    0.0
                         factor                      ExprParser              src/ExprParser.hs:(206,1)-(211,18)          4876           0    0.0    0.0     0.0    0.0
                         funcCall                    ExprParser              src/ExprParser.hs:(195,1)-(199,31)          4873           0    0.0    0.0     0.0    0.0
                          loxArguments               ExprParser              src/ExprParser.hs:202:1-34                  4968           0    0.0    0.0     0.0    0.0
                         loxPrimary                  ExprParser              src/ExprParser.hs:168:1-89                  4865           0    0.0    0.0     0.0    0.0
                          ifStmt                     ExprParser              src/ExprParser.hs:(306,1)-(323,18)          4922           0    0.0    0.0     0.0    0.0
                           loxBlock'                 ExprParser              src/ExprParser.hs:(343,1)-(355,18)          5052           0    0.0    0.0     0.0    0.0
                            loxDeclaration           ExprParser              src/ExprParser.hs:(373,1)-(382,18)          5053           0    0.0    0.0     0.0    0.0
                             loxAssignment           ExprParser              src/ExprParser.hs:(364,1)-(370,18)          5054           0    0.0    0.0     0.0    0.0
                           loxParenExpr              ExprParser              src/ExprParser.hs:(157,1)-(165,26)          4923           0    0.0    0.0     0.0    0.0
                          literal                    ExprParser              src/ExprParser.hs:(131,1)-(134,17)          4867           0    0.0    0.0     0.0    0.0
                          loxBool                    ExprParser              src/ExprParser.hs:(143,1)-(147,17)          4868           0    0.0    0.0     0.0    0.0
                          loxDeclaration             ExprParser              src/ExprParser.hs:(373,1)-(382,18)          5050           0    0.0    0.0     0.0    0.0
                           loxAssignment             ExprParser              src/ExprParser.hs:(364,1)-(370,18)          5051           0    0.0    0.0     0.0    0.0
                          loxIdentifier              ExprParser              src/ExprParser.hs:(137,1)-(140,17)          4871           0    0.0    0.0     0.0    0.0
                          loxNil                     ExprParser              src/ExprParser.hs:(151,1)-(154,17)          4869           0    0.0    0.0     0.0    0.0
                          loxParenExpr               ExprParser              src/ExprParser.hs:(157,1)-(165,26)          4870           0    0.0    0.0     0.0    0.0
                          loxReturn                  ExprParser              src/ExprParser.hs:(402,1)-(410,18)          4943           0    0.0    0.0     0.0    0.0
                           ifStmt                    ExprParser              src/ExprParser.hs:(306,1)-(323,18)          5000           0    0.0    0.0     0.0    0.0
                           semi                      ExprParser              src/ExprParser.hs:(273,1)-(277,18)          4946           0    0.0    0.0     0.0    0.0
                          number                     ExprParser              src/ExprParser.hs:(125,1)-(128,17)          4866           0    0.0    0.0     0.0    0.0
                          semi                       ExprParser              src/ExprParser.hs:(273,1)-(277,18)          5049           0    0.0    0.0     0.0    0.0
                        unary'                       ExprParser              src/ExprParser.hs:(171,1)-(175,17)          4863           0    0.0    0.0     0.0    0.0
                     loxLogicAnd                     ExprParser              src/ExprParser.hs:(265,1)-(269,18)          4856           0    0.0    0.0     0.0    0.0
                  loxLogicOr                         ExprParser              src/ExprParser.hs:(258,1)-(262,18)          4782           0    0.0    0.0     0.0    0.0
                   leftChainLogic                    ExprParser              src/ExprParser.hs:(111,1)-(120,47)          4783           0    0.0    0.0     0.0    0.0
                    equality                         ExprParser              src/ExprParser.hs:(233,1)-(238,18)          4789           0    0.0    0.0     0.0    0.0
                     leftChain                       ExprParser              src/ExprParser.hs:(99,1)-(108,47)           4790           0    0.0    0.0     0.0    0.0
                      comparison                     ExprParser              src/ExprParser.hs:(223,1)-(230,18)          4793           0    0.0    0.0     0.0    0.0
                      factor                         ExprParser              src/ExprParser.hs:(206,1)-(211,18)          4799           0    0.0    0.0     0.0    0.0
                      term                           ExprParser              src/ExprParser.hs:(214,1)-(219,18)          4796           0    0.0    0.0     0.0    0.0
                      unary                          ExprParser              src/ExprParser.hs:179:1-27                  4801           0    0.0    0.0     0.0    0.0
                       call                          ExprParser              src/ExprParser.hs:(182,1)-(192,52)          4808           0    0.0    0.0     0.0    0.0
                        loxPrimary                   ExprParser              src/ExprParser.hs:168:1-89                  4810           0    0.0    0.0     0.0    0.0
                         assignment                  ExprParser              src/ExprParser.hs:(241,1)-(252,26)          4949           0    0.0    0.0     0.0    0.0
                         ifStmt                      ExprParser              src/ExprParser.hs:(306,1)-(323,18)          4844           0    0.0    0.0     0.0    0.0
                          assignment                 ExprParser              src/ExprParser.hs:(241,1)-(252,26)          4958           0    0.0    0.0     0.0    0.0
                          ifStmt.elseStmt            ExprParser              src/ExprParser.hs:(321,5)-(323,18)          4961           0    0.0    0.0     0.0    0.0
                          loxBlock'                  ExprParser              src/ExprParser.hs:(343,1)-(355,18)          5001           0    0.0    0.0     0.0    0.0
                          loxParenExpr               ExprParser              src/ExprParser.hs:(157,1)-(165,26)          4849           0    0.0    0.0     0.0    0.0
                         literal                     ExprParser              src/ExprParser.hs:(131,1)-(134,17)          4817           0    0.0    0.0     0.0    0.0
                         loxBlock                    ExprParser              src/ExprParser.hs:358:1-34                  4934           0    0.0    0.0     0.0    0.0
                          loxBlock'                  ExprParser              src/ExprParser.hs:(343,1)-(355,18)          4935           0    0.0    0.0     0.0    0.0
                         loxBool                     ExprParser              src/ExprParser.hs:(143,1)-(147,17)          4821           0    0.0    0.0     0.0    0.0
                         loxIdentifier               ExprParser              src/ExprParser.hs:(137,1)-(140,17)          4835           0    0.0    0.0     0.0    0.0
                         loxNil                      ExprParser              src/ExprParser.hs:(151,1)-(154,17)          4825           0    0.0    0.0     0.0    0.0
                         loxParenExpr                ExprParser              src/ExprParser.hs:(157,1)-(165,26)          4828           0    0.0    0.0     0.0    0.0
                         loxPrintStmt                ExprParser              src/ExprParser.hs:(297,1)-(303,18)          4838           0    0.0    0.0     0.0    0.0
                         loxReturn                   ExprParser              src/ExprParser.hs:(402,1)-(410,18)          4937           0    0.0    0.0     0.0    0.0
                          assignment                 ExprParser              src/ExprParser.hs:(241,1)-(252,26)          4950           0    0.0    0.0     0.0    0.0
                          loxBlock                   ExprParser              src/ExprParser.hs:358:1-34                  4951           0    0.0    0.0     0.0    0.0
                           loxBlock'                 ExprParser              src/ExprParser.hs:(343,1)-(355,18)          4952           0    0.0    0.0     0.0    0.0
                            assignment               ExprParser              src/ExprParser.hs:(241,1)-(252,26)          4957           0    0.0    0.0     0.0    0.0
                         number                      ExprParser              src/ExprParser.hs:(125,1)-(128,17)          4813           0    0.0    0.0     0.0    0.0
                         whileStmt                   ExprParser              src/ExprParser.hs:(327,1)-(335,18)          4928           0    0.0    0.0     0.0    0.0
                       unary'                        ExprParser              src/ExprParser.hs:(171,1)-(175,17)          4803           0    0.0    0.0     0.0    0.0
                    loxLogicAnd                      ExprParser              src/ExprParser.hs:(265,1)-(269,18)          4786           0    0.0    0.0     0.0    0.0
           runScript.lex_result                      ExprInterpreter         src/ExprInterpreter.hs:305:7-44             4636           1    0.0    0.0     0.0    0.0
            scanner                                  Scanner                 src/Scanner.hs:240:1-42                     4638           0    0.0    0.0     0.0    0.0
             scanToken                               Scanner                 src/Scanner.hs:(231,1)-(237,25)             4640           0    0.0    0.0     0.0    0.0
              scanComment                            Scanner                 src/Scanner.hs:(223,1)-(228,75)             4642           0    0.0    0.0     0.0    0.0
               scanDoubleToken                       Scanner                 src/Scanner.hs:(126,1)-(132,46)             4644           0    0.0    0.0     0.0    0.0
                scanDoubleToken.build                Scanner                 src/Scanner.hs:132:5-46                     4648           0    0.0    0.0     0.0    0.0
                 scanSingleCharToken                 Scanner                 src/Scanner.hs:(109,1)-(115,44)             4650           0    0.0    0.0     0.0    0.0
                  scanSingleCharToken.build          Scanner                 src/Scanner.hs:115:5-44                     4654           0    0.0    0.0     0.0    0.0
                   scanQuotedString                  Scanner                 src/Scanner.hs:(196,1)-(199,81)             4656           0    0.0    0.0     0.0    0.0
                    scanDouble                       Scanner                 src/Scanner.hs:(169,1)-(181,73)             4659           0    0.0    0.0     0.0    0.0
                     scanDouble.secondCharacter      Scanner                 src/Scanner.hs:(178,5)-(181,73)             4696           4    0.0    0.0     0.0    0.0
                     checkIfIdentifier               Scanner                 src/Scanner.hs:(212,1)-(220,70)             4662           0    0.0    0.0     0.0    0.0
                      var                            Scanner                 src/Scanner.hs:(203,1)-(209,70)             4664           0    0.0    0.0     0.0    0.0
                       var.firstChar                 Scanner                 src/Scanner.hs:208:5-54                     4667           0    0.0    0.0     0.0    0.0
                        var.firstChar.\              Scanner                 src/Scanner.hs:208:32-53                    4668          19    0.0    0.0     0.0    0.0
                        whitespace                   Scanner                 src/Scanner.hs:81:1-40                      4710           0    0.0    0.0     0.0    0.0
                         checkIfIdentifier.result    Scanner                 src/Scanner.hs:(217,5)-(220,70)             4711           0    0.0    0.0     0.0    0.0
                       var.nonFirstChar              Scanner                 src/Scanner.hs:209:5-70                     4671           0    0.0    0.0     0.0    0.0
                        var.nonFirstChar.\           Scanner                 src/Scanner.hs:209:35-69                    4672          50    0.0    0.0     0.0    0.0
                        var.firstChar                Scanner                 src/Scanner.hs:208:5-54                     4673           0    0.0    0.0     0.0    0.0
                         whitespace                  Scanner                 src/Scanner.hs:81:1-40                      4675           0    0.0    0.0     0.0    0.0
                          checkIfIdentifier.result   Scanner                 src/Scanner.hs:(217,5)-(220,70)             4677          19    0.0    0.0     0.0    0.0
                     checkIfIdentifier.result        Scanner                 src/Scanner.hs:(217,5)-(220,70)             4709           0    0.0    0.0     0.0    0.0
                     scanDouble.la                   Scanner                 src/Scanner.hs:171:7-62                     4701           0    0.0    0.0     0.0    0.0
                      whitespaceToken                Scanner                 src/Scanner.hs:(163,1)-(166,59)             4703           0    0.0    0.0     0.0    0.0
                   whitespace                        Scanner                 src/Scanner.hs:81:1-40                      4678           0    0.0    0.0     0.0    0.0
                    checkIfIdentifier.result         Scanner                 src/Scanner.hs:(217,5)-(220,70)             4685           0    0.0    0.0     0.0    0.0
                    scanQuotedString                 Scanner                 src/Scanner.hs:(196,1)-(199,81)             4679           0    0.0    0.0     0.0    0.0
                     scanDouble                      Scanner                 src/Scanner.hs:(169,1)-(181,73)             4680           0    0.0    0.0     0.0    0.0
                      checkIfIdentifier              Scanner                 src/Scanner.hs:(212,1)-(220,70)             4681           0    0.0    0.0     0.0    0.0
                       var                           Scanner                 src/Scanner.hs:(203,1)-(209,70)             4682           0    0.0    0.0     0.0    0.0
                        var.nonFirstChar             Scanner                 src/Scanner.hs:209:5-70                     4683           0    0.0    0.0     0.0    0.0
                         var.firstChar               Scanner                 src/Scanner.hs:208:5-54                     4684           0    0.0    0.0     0.0    0.0
                      checkIfIdentifier.result       Scanner                 src/Scanner.hs:(217,5)-(220,70)             4708           0    0.0    0.0     0.0    0.0
                      scanDouble.la                  Scanner                 src/Scanner.hs:171:7-62                     4705           0    0.0    0.0     0.0    0.0
                       scanDouble.secondCharacter    Scanner                 src/Scanner.hs:(178,5)-(181,73)             4707           0    0.0    0.0     0.0    0.0
                      scanDouble.secondCharacter     Scanner                 src/Scanner.hs:(178,5)-(181,73)             4706           0    0.0    0.0     0.0    0.0
                 whitespace                          Scanner                 src/Scanner.hs:81:1-40                      4686           0    0.0    0.0     0.0    0.0
                  checkIfIdentifier.result           Scanner                 src/Scanner.hs:(217,5)-(220,70)             4695           0    0.0    0.0     0.0    0.0
                  scanSingleCharToken                Scanner                 src/Scanner.hs:(109,1)-(115,44)             4687           0    0.0    0.0     0.0    0.0
                   scanSingleCharToken.build         Scanner                 src/Scanner.hs:115:5-44                     4688           0    0.0    0.0     0.0    0.0
                    scanQuotedString                 Scanner                 src/Scanner.hs:(196,1)-(199,81)             4689           0    0.0    0.0     0.0    0.0
                     scanDouble                      Scanner                 src/Scanner.hs:(169,1)-(181,73)             4690           0    0.0    0.0     0.0    0.0
                      checkIfIdentifier              Scanner                 src/Scanner.hs:(212,1)-(220,70)             4691           0    0.0    0.0     0.0    0.0
                       var                           Scanner                 src/Scanner.hs:(203,1)-(209,70)             4692           0    0.0    0.0     0.0    0.0
                        var.nonFirstChar             Scanner                 src/Scanner.hs:209:5-70                     4693           0    0.0    0.0     0.0    0.0
                         var.firstChar               Scanner                 src/Scanner.hs:208:5-54                     4694           0    0.0    0.0     0.0    0.0
           runScript.w                               ExprInterpreter         src/ExprInterpreter.hs:311:15-52            5055           1    0.0    0.0   100.0  100.0
            interpretProgram                         ExprInterpreter         src/ExprInterpreter.hs:(294,1)-(301,35)     5057           0    0.8    0.0   100.0  100.0
             interpretProgram.go                     ExprInterpreter         src/ExprInterpreter.hs:(296,5)-(301,35)     5058    59721410    3.0    6.1    99.1  100.0
              interpretDeclaration                   ExprInterpreter         src/ExprInterpreter.hs:(272,1)-(291,25)     5059    59721410    1.4    0.0    96.2   93.9
               interpretStmt                         ExprInterpreter         src/ExprInterpreter.hs:(222,1)-(268,84)     5061    74651760    5.2    4.9    94.7   93.9
                interpret                            ExprInterpreter         src/ExprInterpreter.hs:(133,1)-(219,101)    5062   268746326   61.1   55.2    89.6   89.1
                 unpackIdent                         ExprInterpreter         src/ExprInterpreter.hs:(97,1)-(103,33)      5084   149303512    2.4    4.6     2.4    4.6
                 lookupEnv                           ExprInterpreter         src/ExprInterpreter.hs:(60,1)-(65,24)       5069   104512462    1.3    0.0     7.5    2.1
                  lookupEnv.go                       ExprInterpreter         src/ExprInterpreter.hs:(62,5)-(65,24)       5070   119442814    6.1    2.1     6.1    2.1
                 applyCompOpToDouble                 ExprInterpreter         src/ExprInterpreter.hs:(120,1)-(130,19)     5085    29860703    2.6    4.9     2.6    4.9
                 interpret.f                         ExprInterpreter         src/ExprInterpreter.hs:(217,5)-(219,101)    5094    29860703    1.5    2.1     1.5    2.1
                 interpret.pa                        ExprInterpreter         src/ExprInterpreter.hs:206:11-33            5076    29860703    1.9    3.0     1.9    3.0
                 interpret.s                         ExprInterpreter         src/ExprInterpreter.hs:208:11-57            5077    29860703    1.7    2.4     4.5    4.3
                  initEnv                            ExprInterpreter         src/ExprInterpreter.hs:57:1-50              5078    29860703    0.0    0.0     0.0    0.0
                  multiInsertEnv                     ExprInterpreter         src/ExprInterpreter.hs:(81,1)-(85,18)       5079    29860703    0.6    0.0     2.9    1.8
                   multiInsertEnv.new_env            ExprInterpreter         src/ExprInterpreter.hs:82:3-29              5082    29860703    1.7    1.8     1.7    1.8
                   multiInsertEnv.new_env'           ExprInterpreter         src/ExprInterpreter.hs:83:3-33              5083    29860703    0.5    0.0     0.5    0.0
                 interpret.s'                        ExprInterpreter         src/ExprInterpreter.hs:210:11-86            5080    29860703    0.4    0.0     4.6    6.7
                  insertEnv                          ExprInterpreter         src/ExprInterpreter.hs:78:1-55              5081    29860703    4.2    6.7     4.2    6.7
                 isTruthy                            ExprInterpreter         src/ExprInterpreter.hs:(44,1)-(46,17)       5086    29860703    0.0    0.0     0.0    0.0
                 applyOpToDouble                     ExprInterpreter         src/ExprInterpreter.hs:(108,1)-(118,19)     5091    29860702    2.9    5.5     2.9    5.5
                 interpretStmt.s'                    ExprInterpreter         src/ExprInterpreter.hs:234:7-27             5092    14930352    0.6    0.8     0.6    0.8
                  initEnv                            ExprInterpreter         src/ExprInterpreter.hs:57:1-50              5093    14930352    0.0    0.0     0.0    0.0
                showLoxValue                         ExprInterpreter         src/ExprInterpreter.hs:(89,1)-(94,34)       5071           2    0.0    0.0     0.0    0.0
               interpret                             ExprInterpreter         src/ExprInterpreter.hs:(133,1)-(219,101)    5060           1    0.0    0.0     0.0    0.0
               interpretDeclaration.closure'         ExprInterpreter         src/ExprInterpreter.hs:289:7-49             5065           1    0.0    0.0     0.0    0.0
                insertEnv                            ExprInterpreter         src/ExprInterpreter.hs:78:1-55              5066           1    0.0    0.0     0.0    0.0
               interpretDeclaration.func             ExprInterpreter         src/ExprInterpreter.hs:288:7-60             5068           1    0.0    0.0     0.0    0.0
               interpretDeclaration.s'               ExprInterpreter         src/ExprInterpreter.hs:275:7-33             5063           1    0.0    0.0     0.0    0.0
                insertEnv                            ExprInterpreter         src/ExprInterpreter.hs:78:1-55              5064           1    0.0    0.0     0.0    0.0
         newLogFunc                                  RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(407,1)-(424,12)  5095           0    0.0    0.0     0.0    0.0
          takeMVar                                   UnliftIO.MVar           src/UnliftIO/MVar.hs:46:1-30                5096           1    0.0    0.0     0.0    0.0
      newLogFunc                                     RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(407,1)-(424,12)  4618           0    0.0    0.0     0.0    0.0
       newMVar                                       UnliftIO.MVar           src/UnliftIO/MVar.hs:40:1-28                4621           0    0.0    0.0     0.0    0.0
    withLogFunc.\                                    RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(445,51)-(448,29) 4610           0    0.0    0.0     0.0    0.0
     newLogFunc                                      RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:(407,1)-(424,12)  4611           1    0.0    0.0     0.0    0.0
      logTerminal                                    RIO.Prelude.Logger      src/RIO/Prelude/Logger.hs:469:5-15          4612           1    0.0    0.0     0.0    0.0
@gdevanla
Copy link
Owner Author

gdevanla commented Oct 2, 2021

Note that I have also take the brute force approach for now and make most of values strict. Here is the memory profile:

time .stack-work/dist/x86_64-linux/Cabal-3.2.1.0/build/scanner-exe-1/scanner-exe-1 t1.lox +RTS -hy -p
35.0
9227465.0
.stack-work/dist/x86_64-linux/Cabal-3.2.1.0/build/scanner-exe-1/scanner-exe-1  160.45s user 22.78s system 361% cpu 50.708 total

$ stack exec -- hp2ps -e8in -c scanner-exe-1.hp && xdg-open scanner-exe-1.ps                           
(base) 
#  ~/fsf/haskell-lox on git:functions x 

memory_profile

@soupi
Copy link

soupi commented Oct 2, 2021

Remove the lines - -threaded and - -with-rtsopts=-N from your package.yaml file for a significant performance boost. Run the executable with +RTS -sstderr and compare the productivity precentage.

@gdevanla
Copy link
Owner Author

gdevanla commented Oct 2, 2021

Thanks, @soupi . I see a lot of improvement. But, it is still slower that what you would like. Here are the numbers:

$ time .stack-work/dist/x86_64-linux/Cabal-3.2.1.0/build/scanner-exe-1/scanner-exe-1 t1.lox            
40.0
1.02334155e8
.stack-work/dist/x86_64-linux/Cabal-3.2.1.0/build/scanner-exe-1/scanner-exe-1  165.00s user 0.53s system 99% cpu 2:45.80 total

@gdevanla
Copy link
Owner Author

gdevanla commented Oct 3, 2021

Update: I INLINED a bunch of functions and that had reduced the time for n=35 to around 12s. But, n=40 is still slow.

@soupi
Copy link

soupi commented Oct 3, 2021

Where is the java code you are comparing against?

@gdevanla
Copy link
Owner Author

gdevanla commented Oct 3, 2021

The java code is gradually built up in each chapter. You are probably looking for this code:

https://github.com/munificent/craftinginterpreters/blob/master/java/com/craftinginterpreters/lox/Interpreter.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants