You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<imgsrc="/docs/assets/i-guess-we-doin-different-runtimes-now.png"alt="Factory worker questioning why someone would compare heaps from different runtimes"width="350">
7
+
</p>
6
8
9
+
> Compare JS heaps from engines like V8, where the heaps are sourced from different runtimes.
10
+
11
+
Compatible with heap outputs from Chrome Developer Tools and parsing techniques from [Memlab](https://facebook.github.io/memlab/)
Check out [examples/compare-heaps.js](examples/compare-heaps.js) for a quick-start.
26
+
20
27
It's recommended to use the `--max-old-space-size=8192` flag when running the script to avoid memory issues, especially when multiple threads are used.
28
+
29
+
### Option: `presenterFilePath`
21
30
Outputs are saved in the `presenterFilePath` directory. Any returns from the compare function are not planned due to the excessive use of memory.
22
-
- $presenterFilePath/statistics.json: Contains the statistics of the comparison, e.g. the number of objects, the number of objects that are the same, the number of objects that are different, etc.
23
-
- $presenterFilePath/perfect-match.json: Contains the objects that are the same in both heap files.
24
-
- $presenterFilePath/next-best-match.json: Contains the objects that are similar in both heap files.
25
-
- $presenterFilePath/disjunct-nodes.json: Contains the objects that are different in both heap files.
31
+
-`$presenterFilePath/statistics.json`: Contains the statistics of the comparison, e.g. the number of objects, the number of objects that are the same, the number of objects that are different, etc.
32
+
-`$presenterFilePath/perfect-match.json`: Contains the objects that are the same in both heap files.
33
+
-`$presenterFilePath/next-best-match.json`: Contains the objects that are similar in both heap files.
34
+
-`$presenterFilePath/disjunct-nodes.json`: Contains the objects that are different in both heap files.
35
+
36
+
### Option: `activePresenter`
37
+
Toggles the type of presenter to output. The least memory intensive is `statistics`, as only the metadata is saved.
38
+
The presenter `disjunctNodes` outputs all nodes that couldn't be matches with one another.
39
+
Presenters `perfectMatch` and `nextBestMatch` are bound to change to output matches in an efficient way.
40
+
41
+
```javascript
42
+
activePresenter: {
43
+
statistics:true,
44
+
perfectMatch:false,
45
+
nextBestMatch:false,
46
+
disjunctNodes:false,
47
+
}
48
+
```
49
+
50
+
### Option: `nextBestMatchObjectThreshold`
51
+
Input value between `0.0` and `1.0`. Defines threshold for next best match algorithm, which ranks the similarity of serializable objects.
52
+
It's recommended to stay above `0.5` for large heaps.
0 commit comments