{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreicd7yxirmoirni3ndugrcqc55fuhcoukzjli2xwqdlquo33p45y3m",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mkfhd4q6wrc2"
  },
  "path": "/t/help-with-optimization-profiling/13982#post_9",
  "publishedAt": "2026-04-26T09:37:02.000Z",
  "site": "https://discourse.haskell.org",
  "textContent": "To look at core I like to put this at the top of the file:\n\n\n    {-# OPTIONS_GHC -ddump-simpl -dsuppress-all -dno-suppress-type-signatures -dno-typeable-binds -ddump-to-file #-}\n\n\nAfterwards I do a `find . -name \"*.dump-simpl\"` which shows that on my machine it generated the dump at this location:\n\n\n    % find . -name \"*.dump-simpl\"\n    ./dist-newstyle/build/aarch64-osx/ghc-9.10.3/hs-plugui-1.0.1/x/main/build/main/main-tmp/app/Main.dump-simpl\n\n\nThat file contains the Core dump which is the intermediate language that GHC has applied most of its optimizations to.\n\nI do notice that it doesn’t give much extra information in this case. There is quite some aggressive inlining which you can work around by adding `{-# NOINLINE #-}` to `imageBytes`, `generateImage` and `encodePalettedPng`, which doesn’t really change the running time.\n\n**In this case I think there’s not much to win from looking at`imageBytes` because it is basically just calling two library functions.**\n\nSo optimizing this further would basically mean optimizing the underlying libraries.",
  "title": "Help with optimization/profiling"
}