{"id":28239514,"url":"https://github.com/codedownio/time-ghc-modules","last_synced_at":"2025-07-26T00:11:03.212Z","repository":{"id":48269523,"uuid":"391215956","full_name":"codedownio/time-ghc-modules","owner":"codedownio","description":"Analyze GHC .dump-timings files","archived":false,"fork":false,"pushed_at":"2024-02-14T05:29:47.000Z","size":6785,"stargazers_count":106,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-19T02:12:35.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codedownio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-07-31T00:16:15.000Z","updated_at":"2025-04-08T07:58:25.000Z","dependencies_parsed_at":"2024-02-07T05:45:30.821Z","dependency_job_id":null,"html_url":"https://github.com/codedownio/time-ghc-modules","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedownio%2Ftime-ghc-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedownio%2Ftime-ghc-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedownio%2Ftime-ghc-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedownio%2Ftime-ghc-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codedownio","download_url":"https://codeload.github.com/codedownio/time-ghc-modules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedownio%2Ftime-ghc-modules/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259221844,"owners_count":22823974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-19T02:12:33.939Z","updated_at":"2025-06-11T07:30:59.527Z","avatar_url":"https://github.com/codedownio.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# time-ghc-modules\n\nFigure out why your builds are slow. This tool analyzes how long it takes GHC to compile your Haskell modules, broken down by phase. It can draw both bar charts and treemaps, of time or space usage.\n\n# Quick start\n\n``` shell\ncd \u003cmy-project\u003e\n\nstack clean\nstack build --ghc-options \"-ddump-to-file -ddump-timings\"\n# ----- OR -----\ncabal clean\ncabal build all --ghc-options \"-ddump-to-file -ddump-timings\"\n```\n\nIf you have Nix, you can simply run `time-ghc-modules` from Nixpkgs!\n\n``` shell\nnix run nixpkgs#time-ghc-modules\n```\n\nOr, clone the repo first:\n\n``` shell\ngit clone git@github.com:codedownio/time-ghc-modules.git /path/to/time-ghc-modules\n\n# If you have Nix, you can use the fully reproducible version\n/path/to/time-ghc-modules/time-ghc-modules-nix\n\n# Otherwise, your system needs to have SQLite \u003e= 3.33.0, Python 3, and sed\n/path/to/time-ghc-modules/time-ghc-modules\n```\n\nThe script will search for all your `*.dump-timings` files and analyze them. It will finish by printing out the path to an HTML file:\n\n``` shell\n...\n--\u003e Wrote report at file:///tmp/tmp.pvnp4FYmLa/report.html\n```\n\n# Example: hledger\n\nYou can generate the time report below for [hledger](https://github.com/simonmichael/hledger) by running the following commands (assuming you have Nix).\n\n``` shell\nset -e\ncd $(mktemp -d)\ngit clone git@github.com:simonmichael/hledger.git\ngit clone git@github.com:codedownio/time-ghc-modules.git\ncd hledger\nstack build --ghc-options \"-ddump-to-file -ddump-timings\"\n../time-ghc-modules/time-ghc-modules-nix\n```\n\n![hledger profile](./hledger.gif)\n\n# Tips\n\n* The script will output its log messages to `stderr` and print the final report path to `stdout` (assuming it didn't exit with a failure). This makes it easy to use the output in scripts. For example:\n\n``` shell\n# Build the report and open it in your browser\n\u003e firefox $(/path/to/time-ghc-modules/time-ghc-modules)\n```\n\n``` shell\n# Build the report in CI and stash it somewhere\n\u003e cp $(/path/to/time-ghc-modules/time-ghc-modules) $MY_CI_ARTIFACTS_DIR/\n```\n\n* You can also look at the timing of individual components, but doing e.g. `stack build some-component:lib`. But, make sure to clean up any old `.dump-timings` files from previous runs:\n\n``` shell\nfind . -name \"*.dump-timings\" | xargs rm\n```\n\n* GHC's `-dumpdir` option can be used to consolidate the `.dump-timings` files, so they aren't left all over your source tree. For example:\n\n``` shell\nstack build --ghc-options \"-ddump-to-file -ddump-timings -dumpdir .ghcdump\"\n```\n\n# Compatibility\n\nThe flag `-ddump-timings` is available for `GHC \u003e= 8.4.1`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodedownio%2Ftime-ghc-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodedownio%2Ftime-ghc-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodedownio%2Ftime-ghc-modules/lists"}