@@ -62,36 +62,50 @@ cpp-options: -DBENCH_containers_Map -DBENCH_containers_IntMap -DBENCH_hashmap_Ma
6262
6363## Inspecting the generated code
6464
65- The library section in ` unordered-containers. cabal` contains a commented-out set of ` ghc-options ` for
66- dumping Core and other forms of generated code. To dump this code, uncomment these options and run
65+ The file ` cabal.project.local.dump-code ` contains ` ghc-options ` for dumping Core and
66+ other forms of generated code. To dump this code, run
6767
6868```
69+ cp cabal.project.local.dump-code cabal.project.local
6970cabal clean
70- cabal build
71- ```
72-
73- You can find the resulting ` .dump-* ` files in ` dist-newstyle/build/**/unordered-containers-*/build/ ` , e.g.
74-
75- ```
76- $ tree dist-newstyle/build/x86_64-linux/ghc-9.2.2/unordered-containers-0.2.16.0/build/
77- dist-newstyle/build/x86_64-linux/ghc-9.2.2/unordered-containers-0.2.16.0/build/
78- ├── Data
79- │ ├── HashMap
80- │ │ ├── Internal
81- │ │ │ ├── Array.dump-asm
82- │ │ │ ├── Array.dump-cmm
83- │ │ │ ├── Array.dump-simpl
84- │ │ │ ├── Array.dump-stg-final
71+ cabal build benches tests
72+ ```
73+
74+ You can find the resulting ` .dump-* ` files in ` dist-newstyle/build/*/*/unordered-containers-*/ ` , e.g.
75+
76+ ```
77+ $ tree dist-newstyle/build/*/*/unordered-containers-*/
78+ dist-newstyle/build/x86_64-linux/ghc-9.12.2/unordered-containers-0.2.20.1/
79+ ├── b
80+ │ ├── fine-grained
81+ │ │ ├── build
82+ │ │ │ └── fine-grained
83+ │ │ │ ├── autogen
84+ │ │ │ │ ├── cabal_macros.h
85+ │ │ │ │ ├── PackageInfo_unordered_containers.hs
86+ │ │ │ │ └── Paths_unordered_containers.hs
87+ │ │ │ ├── fine-grained
88+ │ │ │ └── fine-grained-tmp
89+ │ │ │ ├── benchmarks
90+ │ │ │ │ ├── FineGrained.dump-asm
91+ │ │ │ │ ├── FineGrained.dump-cmm
92+ │ │ │ │ ├── FineGrained.dump-prep
93+ │ │ │ │ ├── FineGrained.dump-simpl
8594...
8695```
8796
88- To visually compare the generated code from two different states of the source tree, you can copy
89- the ` dist-newstyle/build/**/unordered-containers-*/build/ ` directory from each state to two
90- directories ` a ` and ` b ` and then use a diff tool like [ Meld ] ( https://meldmerge.org/ ) to compare
91- them:
97+ To visually compare the generated code from two different states of the source tree,
98+ you can copy the ` dist-newstyle/build/*/ */unordered-containers-*/ ` directory from
99+ each state to separate directories and then use a diff tool like
100+ [ Meld ] ( https://meldmerge.org/ ) to compare them:
92101
93102```
94- meld a/ b/
103+ cabal clean
104+ cabal build benches tests
105+ mkdir dump-$(git rev-parse HEAD)
106+ cp -r dist-newstyle/build/*/*/unordered-containers-*/ dump-$(git rev-parse HEAD)
107+ # Repeat at different commit
108+ meld dump-*
95109```
96110
97111### References
0 commit comments