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

Performance Impact #43

Open
fxdpntthm opened this issue May 24, 2022 · 1 comment
Open

Performance Impact #43

fxdpntthm opened this issue May 24, 2022 · 1 comment

Comments

@fxdpntthm
Copy link
Collaborator


Metrics: compile_time/peak_megabytes_allocated
----------------------------------------------

                                            Baseline
                         Test   Metric         value     New value  Change
-------------------------------------------------------------------------------------------
MultiLayerModulesNoCode(ghci) ghc/peak         112.0         114.0   +1.8%
               T11545(normal) ghc/peak          84.0         161.0  +91.7% BAD
               T15304(normal) ghc/peak          75.0         133.0  +77.3% BAD
               T15630(normal) ghc/peak          25.0          85.0 +240.0% BAD
              T18698a(normal) ghc/peak          37.0         139.0 +275.7% BAD
              T18698b(normal) ghc/peak          37.0         141.0 +281.1% BAD
                T1969(normal) ghc/peak          50.0          51.0   +2.0%
                T3294(normal) ghc/peak          84.0          95.0  +13.1%
                T9630(normal) ghc/peak          94.0         209.0 +122.3% BAD
                T9675(optasm) ghc/peak          44.0          43.0   -2.3%

* All baselines were measured in the same environment as this test run
* All baseline commits are 4a98ee910a

Metrics: compile_time/max_bytes_used
------------------------------------

                                           Baseline
                         Test  Metric         value     New value  Change
------------------------------------------------------------------------------------------
MultiLayerModulesNoCode(ghci) ghc/max    42161752.0    43257720.0   +2.6%
               T11545(normal) ghc/max    38553536.0    76174624.0  +97.6% BAD
               T15304(normal) ghc/max    29628040.0    50678208.0  +71.0% BAD
               T15630(normal) ghc/max     8979496.0    32729976.0 +264.5% BAD
              T18698a(normal) ghc/max    14122176.0    55792448.0 +295.1% BAD
              T18698b(normal) ghc/max    14168976.0    55839936.0 +294.1% BAD
                T1969(normal) ghc/max    18985080.0    19438440.0   +2.4%
                T3294(normal) ghc/max    30965608.0    35367136.0  +14.2%
                T9630(normal) ghc/max    35588888.0    90283944.0 +153.7% BAD
                T9675(optasm) ghc/max    16548344.0    16579816.0   +0.2%

* All baselines were measured in the same environment as this test run
* All baseline commits are 4a98ee910a

Metrics: compile_time/bytes allocated
-------------------------------------

                                         Baseline
                     Test    Metric         value     New value  Change
----------------------------------------------------------------------------------------
 ManyAlternatives(normal) ghc/alloc   738364392.0   760425232.0   +3.0% BAD
 ManyConstructors(normal) ghc/alloc  3871185856.0  4011045176.0   +3.6% BAD
MultiLayerModules(normal) ghc/alloc  3087259496.0  3171427000.0   +2.7%
           T10421(normal) ghc/alloc   111471840.0   210766608.0  +89.1% BAD
          T10421a(normal) ghc/alloc    77706216.0   175773496.0 +126.2% BAD
           T10547(normal) ghc/alloc    28727184.0    67826192.0 +136.1% BAD
           T11545(normal) ghc/alloc   965492032.0  1049124536.0   +8.7%
           T12150(optasm) ghc/alloc    76730848.0   157233808.0 +104.9% BAD
           T13056(optasm) ghc/alloc   363943984.0   474170056.0  +30.3% BAD
       T13253-spj(normal) ghc/alloc   122411816.0   123066920.0   +0.5%
           T13379(normal) ghc/alloc   381941112.0   526736504.0  +37.9% BAD
           T13719(normal) ghc/alloc  3922610968.0  5402651888.0  +37.7% BAD
             T14052(ghci) ghc/alloc  2654632344.0  2957839584.0  +11.4%
           T14697(normal) ghc/alloc   343535112.0   355761352.0   +3.6% BAD
           T15304(normal) ghc/alloc  1238570544.0  1291010048.0   +4.2%
           T15630(normal) ghc/alloc   158711872.0   220912680.0  +39.2% BAD
           T16190(normal) ghc/alloc   279423960.0   362289840.0  +29.7% BAD
           T16875(normal) ghc/alloc    34725432.0    35638592.0   +2.6% BAD
           T17516(normal) ghc/alloc  1720668592.0  1698254288.0   -1.3%
           T18140(normal) ghc/alloc    80499464.0    81657800.0   +1.4%
           T18282(normal) ghc/alloc   130241008.0   185771368.0  +42.6% BAD
           T18304(normal) ghc/alloc    85617704.0   128589200.0  +50.2% BAD
          T18698a(normal) ghc/alloc   332067520.0   418408904.0  +26.0% BAD
          T18698b(normal) ghc/alloc   391536104.0   477995040.0  +22.1% BAD
           T18923(normal) ghc/alloc    67860800.0    68871856.0   +1.5%
            T1969(normal) ghc/alloc   749744120.0   763821592.0   +1.9% BAD
           T20049(normal) ghc/alloc    87644792.0   127953832.0  +46.0% BAD
            T3294(normal) ghc/alloc  1585125480.0  1608220088.0   +1.5% BAD
            T4801(normal) ghc/alloc   323129616.0   373248440.0  +15.5% BAD
            T5030(normal) ghc/alloc   359940624.0   483529608.0  +34.3% BAD
          T5321FD(normal) ghc/alloc   278290064.0   373877168.0  +34.3% BAD
         T5321Fun(normal) ghc/alloc   307634560.0   554626368.0  +80.3% BAD
            T5631(normal) ghc/alloc   560048744.0   707232344.0  +26.3% BAD
            T5642(normal) ghc/alloc   460219920.0  2436488768.0 +429.4% BAD
            T5837(normal) ghc/alloc    35936272.0    75381760.0 +109.8% BAD
            T6048(optasm) ghc/alloc   101370032.0   151112400.0  +49.1% BAD
             T783(normal) ghc/alloc   399341584.0   414952960.0   +3.9% BAD
            T9020(optasm) ghc/alloc   239823408.0   773799240.0 +222.7% BAD
            T9198(normal) ghc/alloc    47961816.0    93133920.0  +94.2% BAD
            T9233(normal) ghc/alloc   671284904.0   733268224.0   +9.2% BAD
            T9630(normal) ghc/alloc  1406480504.0  1808777744.0  +28.6% BAD
            T9675(optasm) ghc/alloc   424636880.0   433734792.0   +2.1% BAD
            T9961(normal) ghc/alloc   342150744.0   344774464.0   +0.8%
   hard_hole_fits(normal) ghc/alloc   483214296.0   775706816.0  +60.5% BAD
       parsing001(normal) ghc/alloc   459914968.0   460995032.0   +0.2%

* All baselines were measured in the same environment as this test run
* All baseline commits are 4a98ee910a

Metrics: runtime/bytes allocated
--------------------------------

                                             Baseline
                         Test    Metric         value     New value      Change
------------------------------------------------------------------------------------------------
          Conversions(normal) run/alloc      107664.0      108016.0       +0.3%
           DeriveNull(normal) run/alloc   112050744.0   192083944.0      +71.4% BAD
     InlineArrayAlloc(normal) run/alloc  1600040744.0  1600041096.0       +0.0%
 InlineByteArrayAlloc(normal) run/alloc  1440040744.0  1440041096.0       +0.0%
InlineCloneArrayAlloc(normal) run/alloc  1600040904.0  1600041256.0       +0.0%
          MethSharing(normal) run/alloc   480098056.0   480098408.0       +0.0%
               T10359(normal) run/alloc      354512.0      354864.0       +0.1%
               T12990(normal) run/alloc    20840760.0    21641112.0       +3.8%
               T12996(normal) run/alloc       84864.0       85216.0       +0.4%
               T13001(normal) run/alloc       50592.0       50944.0       +0.7%
               T13218(normal) run/alloc    82027624.0    82027976.0       +0.0%
               T14936(normal) run/alloc       51120.0       51472.0       +0.7%
               T14955(normal) run/alloc    48050632.0    48050984.0       +0.0%
               T15185(normal) run/alloc       41064.0       80616.0      +96.3% BAD
               T15226(normal) run/alloc       40768.0       41120.0       +0.9%
              T15226a(normal) run/alloc       40768.0       41120.0       +0.9%
               T15263(normal) run/alloc     1063160.0     9463512.0     +790.1% BAD
               T15426(normal) run/alloc   192040904.0   192041256.0       +0.0%
               T15578(normal) run/alloc   400041008.0   400041360.0       +0.0%
               T17123(normal) run/alloc     4675808.0     4676160.0       +0.0%
               T18574(normal) run/alloc       50680.0  3200051032.0 +6314128.6% BAD
               T19347(normal) run/alloc      100848.0      101200.0       +0.3%
                T3586(normal) run/alloc    16101992.0    16102344.0       +0.0%
                T3738(normal) run/alloc       50448.0       50800.0       +0.7%
                T4267(normal) run/alloc       40744.0      129184.0     +217.1% BAD
               T4474a(normal) run/alloc  4831889944.0  4831890296.0       +0.0%
               T4474b(normal) run/alloc  4831889944.0  4831890296.0       +0.0%
               T4474c(normal) run/alloc  4831889944.0  4831890296.0       +0.0%
                T4830(normal) run/alloc       98072.0       98424.0       +0.4%
                T4978(normal) run/alloc    10129160.0    10129512.0       +0.0%
                T5113(normal) run/alloc     8058512.0     8058864.0       +0.0%
                T5205(normal) run/alloc       53576.0       54024.0       +0.8%
                T5237(normal) run/alloc      104184.0      104536.0       +0.3%
                T5536(normal) run/alloc   892536664.0   892570088.0       +0.0%
                T5549(normal) run/alloc  5793140288.0  5793140640.0       +0.0%
                T5949(normal) run/alloc      200760.0      201112.0       +0.2%
                T7619(normal) run/alloc       40744.0       41096.0       +0.9%
                T7797(normal) run/alloc   480050480.0   480050832.0       +0.0%
                T7954(normal) run/alloc  1280050936.0  2320051392.0      +81.2% BAD
                T8472(normal) run/alloc       50680.0       51032.0       +0.7%
                 T876(normal) run/alloc       56936.0     1177280.0    +1967.7% BAD
                T8763(normal) run/alloc       40784.0       41136.0       +0.9%
                T9203(normal) run/alloc    39181648.0    39182000.0       +0.0%
                T9339(normal) run/alloc       50704.0       51056.0       +0.7%
             UniqLoop(normal) run/alloc   800040848.0   800041200.0       +0.0%
              join002(optasm) run/alloc  2000050744.0  2000051096.0       +0.0%
              join003(optasm) run/alloc  2000050744.0  2000051096.0       +0.0%
              join004(optasm) run/alloc    16050648.0   128099000.0     +698.1% BAD
              join007(optasm) run/alloc       50968.0       51320.0       +0.7%
        lazy-bs-alloc(normal) run/alloc      430360.0      430840.0       +0.1%
       space_leak_001(normal) run/alloc  9066688360.0  9066688744.0       +0.0%

* All baselines were measured in the same environment as this test run
* All baseline commits are 4a98ee910a

Metrics: runtime/peak_megabytes_allocated
-----------------------------------------

                                     Baseline
                  Test   Metric         value     New value Change
-------------------------------------------------------------------
   MethSharing(normal) run/peak           1.0           1.0  +0.0%
        T12791(normal) run/peak           1.0           1.0  +0.0%
        T13218(normal) run/peak           1.0           1.0  +0.0%
         T2762(normal) run/peak           1.0           1.0  +0.0%
         T3586(normal) run/peak          17.0          17.0  +0.0%
         T3738(normal) run/peak           1.0           1.0  +0.0%
         T4334(normal) run/peak           2.0           2.0  +0.0%
         T5835(normal) run/peak           1.0           1.0  +0.0%
         T7436(normal) run/peak           1.0           1.0  +0.0%
        T7436b(normal) run/peak           1.0           1.0  +0.0%
 lazy-bs-alloc(normal) run/peak           2.0           2.0  +0.0%
space_leak_001(normal) run/peak           2.0           2.0  +0.0%

* All baselines were measured in the same environment as this test run
* All baseline commits are 4a98ee910a

Metrics: runtime/max_bytes_used
-------------------------------

                                    Baseline
                  Test  Metric         value     New value Change
------------------------------------------------------------------
   MethSharing(normal) run/max       44328.0       44328.0  +0.0%
        T12791(normal) run/max      289520.0      289520.0  +0.0%
        T13218(normal) run/max      365272.0      365272.0  +0.0%
         T2762(normal) run/max       35984.0       35984.0  +0.0%
         T3586(normal) run/max       44328.0       44328.0  +0.0%
         T3738(normal) run/max       44328.0       44328.0  +0.0%
         T4334(normal) run/max       60752.0       60824.0  +0.1%
         T5835(normal) run/max      289520.0      289520.0  +0.0%
         T7436(normal) run/max       60160.0       60160.0  +0.0%
        T7436b(normal) run/max       44328.0       44328.0  +0.0%
 lazy-bs-alloc(normal) run/max       44792.0       44792.0  +0.0%
space_leak_001(normal) run/max      463368.0      463368.0  +0.0%

* All baselines were measured in the same environment as this test run
* All baseline commits are 4a98ee910a

@fxdpntthm
Copy link
Collaborator Author

fxdpntthm commented May 24, 2022

It is expected to see compile_time to be degraded as we perform a huge amount of type elaboration and also type family reductions in certain cases. However for runtime allocation, a particularly surprising example is that of T18574
It is a simple main function:

main :: IO ()
main = print $ even $ sum $ catMaybes $ map xx ([1..100000000] :: [Int])
  where
    xx n | even n    = Just n
            | otherwise = Nothing

The reason being that GHC cannot apply fold build fusion anymore due to the use of sum function.

main
  = $ @GHC.Types.LiftedRep
      @Bool
      @(IO ())
      (print @Bool GHC.Show.$fShowBool)
      ($ @GHC.Types.LiftedRep
         @Int
         @Bool
         (even @Int GHC.Real.$fIntegralInt)
         ($ @GHC.Types.LiftedRep
            @[Int]
            @Int
            (sum
               @[]
               Data.Foldable.$fFoldable[]
               @Int
               GHC.Num.$fNumInt
               (GHC.Classes.(%%)
                `cast` (Sub (Sym (GHC.Types.R:@[]a[0] <Int>_N))
                        :: (() :: Constraint) ~R# ([] @ Int))))
            ($ @GHC.Types.LiftedRep
               @[Maybe Int]
               @[Int]
               (catMaybes @Int)
               (map
                  @Int
                  @(Maybe Int)
                  (\ (n_axx :: Int) ->
                     case even @Int GHC.Real.$fIntegralInt n_axx of {
                       False -> GHC.Maybe.Nothing @Int;
                       True -> GHC.Maybe.Just @Int n_axx
                     })
                  (enumFromTo
                     @Int
                     GHC.Enum.$fEnumInt
                     (GHC.Types.I# 1#)
                     (GHC.Types.I# 100000000#))))))
main
  = $ @GHC.Types.LiftedRep
      @Bool
      @(IO ())
      (print @Bool GHC.Show.$fShowBool)
      ($ @GHC.Types.LiftedRep
         @Int
         @Bool
         (even @Int GHC.Real.$fIntegralInt)
         ($ @GHC.Types.LiftedRep
            @[Int]
            @Int
            (sum @[] Data.Foldable.$fFoldable[] @Int GHC.Num.$fNumInt)
            ($ @GHC.Types.LiftedRep
               @[Maybe Int]
               @[Int]
               (catMaybes @Int)
               (map
                  @Int
                  @(Maybe Int)
                  (\ (n_auv :: Int) ->
                     case even @Int GHC.Real.$fIntegralInt n_auv of {
                       False -> GHC.Maybe.Nothing @Int;
                       True -> GHC.Maybe.Just @Int n_auv
                     })
                  (enumFromTo
                     @Int
                     GHC.Enum.$fEnumInt
                     (GHC.Types.I# 1#)
                     (GHC.Types.I# 100000000#))))))

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

1 participant