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

perf: strictify Meta's ID field #1110

Merged
merged 1 commit into from
Aug 15, 2023
Merged

perf: strictify Meta's ID field #1110

merged 1 commit into from
Aug 15, 2023

Commits on Aug 10, 2023

  1. perf: strictify Meta's ID field

    This one-character change massively reduces our memory usage (measured by
    maximum residency) on some workloads.  When running the testsuite with
    `--hedgehog-tests 0` (to get reproducible results) we see a (roughly)
    15% drop in maximum residency (as measured by `+RTS -s`), and with the
    following patch to run a much bigger version of `EvalFull.unit_8`, we
    see a 97% drop, and the total memory in use drops from 1177MB to 58MB!
    It also has a small beneficial effect on the amount of memory copied
    during GC, and a negligible effect on both total memory allocated and
    elapsed runtimes.
    
    diff --git a/primer/test/Tests/EvalFull.hs b/primer/test/Tests/EvalFull.hs
    index c98878049..9292b2870 100644
    --- a/primer/test/Tests/EvalFull.hs
    +++ b/primer/test/Tests/EvalFull.hs
    @@ -209,13 +209,13 @@ unit_7 =
    
     unit_8 :: Assertion
     unit_8 =
    -  let n = 10
    +  let n = 100
           e = mapEven n
        in do
             evalFullTest (maxID e) builtinTypes (defMap e) 500 Syn (expr e) >>= \case
               Left (TimedOut _) -> pure ()
               x -> assertFailure $ show x
    -        s <- evalFullTest (maxID e) builtinTypes (defMap e) 1000 Syn (expr e)
    +        s <- evalFullTest (maxID e) builtinTypes (defMap e) 100000 Syn (expr e)
             s <~==> Right (expectedResult e)
    
     -- A worker/wrapper'd map
    
    Signed-off-by: Ben Price <[email protected]>
    brprice committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    305560d View commit details
    Browse the repository at this point in the history