... | ... | @@ -44,6 +44,8 @@ Here are some tips and tricks: |
|
|
|
|
|
- Check out [ http://perf.haskell.org/ghc](http://perf.haskell.org/ghc), which may have already bisected the problem for you.
|
|
|
|
|
|
- See [Bisection](working-conventions/bisection) for tips on bisection.
|
|
|
|
|
|
- When comparing the profiles of multiple versions of GHC, you may find yourself needing to maintain multiple build trees with different code. An extremely useful utility for this case is `git-new-workdir`, which is not a default Git command but lives in the `contrib` folder of Git. You can `locate git-new-workdir` to find your copy; it is most commonly installed to `/usr/share/doc/git/contrib/workdir` and add it to your path. Now you can use this command (`git-new-workdir old-working-copy new-working-copy`) to create a new working directory from the old Git repository, that has its own index but shares a repository with the original. Be sure to switch to a different branch, since branch pointers are shared too! What is especially convenient is if you make and commit a temporary change in one working-copy, you can immediately cherry-pick it from the other one, no fetching or patches necessary!
|
|
|
|
|
|
- One important thing to note is that by default, GHC does not define very many cost centers. So if you are comparing the results of two profiles, you may notice that everything gets attributed to something not very informative (e.g. `defaultCleanupHandler`). This is by design: if we slapped `-auto-all` on all of our source files, the profiles would be a lot harder to interpret because there would be so much noise. Instead, you should selectively apply `-auto-all`, probably to the files changed in the offending commit. [compiler/ghc.mk](/trac/ghc/browser/ghc/compiler/ghc.mk) has some guidance on the matter: you can either set `compiler/main/GhcMake_HC_OPTS` to `-auto-all`, or you can add `{-# OPTIONS_GHC -auto-all #-}` to the top of the relevant files. The latter has the benefit that it will also properly trigger recompilation; however, if you're sharing your ``build.mk`` between the old and the new trees, adding the appropriate `HC_OPTS` to your build files prevents you from having to duplicate changes in both trees. These variables can also be passed to `make` on the command line.
|
... | ... | |