@@ -5,15 +5,11 @@ export default Route.extend({
5
5
store : service ( ) ,
6
6
7
7
async model ( ) {
8
- console . groupCollapsed ( 'test-setup' ) ;
9
8
performance . mark ( 'start-data-generation' ) ;
10
9
11
10
const initialPayload = await fetch ( './fixtures/add-children-initial.json' ) . then ( ( r ) => r . json ( ) ) ;
12
11
const initialPayload2 = structuredClone ( initialPayload ) ;
13
-
14
- const payloadWithRemoval = structuredClone ( initialPayload ) ;
15
- payloadWithRemoval . data . relationships . children . data . splice ( 0 , 19000 ) ;
16
- payloadWithRemoval . included . splice ( 0 , 19000 ) ;
12
+ const payloadWithRemoval = await fetch ( './fixtures/add-children-with-removal.json' ) . then ( ( r ) => r . json ( ) ) ;
17
13
18
14
performance . mark ( 'start-push-initial-payload' ) ;
19
15
this . store . push ( initialPayload ) ;
@@ -32,56 +28,29 @@ export default Route.extend({
32
28
const parent = peekedParents [ 0 ] ;
33
29
const children = await parent . children ;
34
30
35
- await logChildren ( parent ) ;
36
- console . groupEnd ( ) ;
37
- console . log ( structuredClone ( getWarpDriveMetricCounts ( ) ) ) ;
38
-
39
31
performance . mark ( 'start-local-removal' ) ;
40
- console . groupCollapsed ( 'start-local-removal' ) ;
41
32
const removedChildren = children . splice ( 0 , 19000 ) ;
42
- await logChildren ( parent ) ;
43
- console . groupEnd ( ) ;
44
- console . log ( structuredClone ( getWarpDriveMetricCounts ( ) ) ) ;
45
33
46
34
performance . mark ( 'start-push-minus-one-payload' ) ;
47
- console . groupCollapsed ( 'start-push-minus-one-payload' ) ;
48
35
this . store . push ( payloadWithRemoval ) ;
49
- await logChildren ( parent ) ;
50
- console . groupEnd ( ) ;
51
- console . log ( structuredClone ( getWarpDriveMetricCounts ( ) ) ) ;
52
36
53
37
performance . mark ( 'start-local-addition' ) ;
54
- console . groupCollapsed ( 'start-local-addition' ) ;
55
38
parent . children = removedChildren . concat ( children ) ;
56
- await logChildren ( parent ) ;
57
- console . groupEnd ( ) ;
58
- console . log ( structuredClone ( getWarpDriveMetricCounts ( ) ) ) ;
59
39
60
40
performance . mark ( 'start-push-plus-one-payload' ) ;
61
- console . groupCollapsed ( 'start-push-plus-one-payload' ) ;
62
41
this . store . push ( initialPayload2 ) ;
63
- await logChildren ( parent ) ;
64
- console . groupEnd ( ) ;
65
- console . log ( structuredClone ( getWarpDriveMetricCounts ( ) ) ) ;
66
42
67
43
performance . mark ( 'end-push-plus-one-payload' ) ;
68
44
} ,
69
45
} ) ;
70
46
71
- async function logChildren ( parent ) {
72
- const children = await parent . children ;
73
- console . log (
74
- `children is an array of length ${ children . length } of ids ${ children . at ( 0 ) . id } ..${ children . at ( children . length - 1 ) . id } `
75
- ) ;
76
- }
77
-
78
47
function iterateChild ( record , seen ) {
79
48
if ( seen . has ( record ) ) {
80
49
return ;
81
50
}
82
51
seen . add ( record ) ;
83
52
84
- record . parent . get ( 'name' ) ;
53
+ record . parent ;
85
54
}
86
55
87
56
function iterateParent ( record , seen ) {
0 commit comments