Commit 572b82f
src: make BaseObject iteration order deterministic
Previously we just rely on the unordered_set order to iterate over
the BaseObjects, which is not deterministic.
The iteration is only used in printing, verification, and snapshot
generation. In the first two cases the performance overhead of
sorting does not matter because they are only used for debugging.
In the last case the determinism is more important than the trivial
overhead of sorting. So this patch makes the iteration deterministic
by sorting the set first, as what is already being done when we
drain the queue.
PR-URL: #48702
Refs: nodejs/build#3043
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>1 parent 9cb18b3 commit 572b82fCopy full SHA for 572b82f
File tree
Expand file treeCollapse file tree
3 files changed
+13
-2
lines changedOpen diff view settings
Filter options
- src
Expand file treeCollapse file tree
3 files changed
+13
-2
lines changedOpen diff view settings
Collapse file
+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
39 | 39 | |
40 | 40 | |
41 | 41 | |
42 | | - |
| 42 | + |
| 43 | + |
| 44 | + |
43 | 45 | |
44 | 46 | |
45 | 47 | |
|
Collapse file
+8-1Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
8 | | - |
| 8 | + |
| 9 | + |
9 | 10 | |
10 | 11 | |
11 | 12 | |
| ||
20 | 21 | |
21 | 22 | |
22 | 23 | |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
23 | 30 | |
24 | 31 | |
25 | 32 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6 | 6 | |
7 | 7 | |
8 | 8 | |
| 9 | + |
9 | 10 | |
10 | 11 | |
11 | 12 | |
| ||
66 | 67 | |
67 | 68 | |
68 | 69 | |
| 70 | + |
69 | 71 | |
70 | 72 | |
71 | 73 | |
|
0 commit comments