Commit cfb1489
perf: batch DB operations in createAttributesScenario to avoid CI timeout (calcom#28320)
* perf: batch DB operations in performance test setup to avoid CI timeout
Replace ~5200 sequential DB inserts with batch createMany() operations
in createHugeAttributesOfTypeSingleSelect. The test was timing out at
60s on 2-vCPU CI runners because the setup phase alone (creating 400
users, 800 memberships, 4000 attribute assignments one-by-one) exceeded
the timeout before the actual logic under test even ran.
Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>
* perf: optimize createAttributesScenario with batch DB operations
Move batch DB operations (createMany) into the shared createAttributesScenario
helper so all tests benefit, not just the performance test. Simplify
createHugeAttributesOfTypeSingleSelect to delegate to the optimized helper.
Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>
* Revert "perf: optimize createAttributesScenario with batch DB operations"
This reverts commit c739edd.
* Revert "perf: batch DB operations in performance test setup to avoid CI timeout"
This reverts commit ff6642a.
* perf: optimize createAttributesScenario with batch DB operations
Replace sequential prisma.*.create() calls in the shared createAttributesScenario
helper with batch createMany() calls, reducing ~5,200 sequential DB operations to
~10 batch operations. Simplify createHugeAttributesOfTypeSingleSelect to delegate
to the optimized helper instead of duplicating batch logic.
Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>
* fix: preserve deterministic user ordering in createAttributesScenario
Map users by email after findMany to ensure the index-based attribute
assignment matches the original userDataList order, since findMany does
not guarantee return order.
Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>
* revert: make test timeout back to 1 min
* refactor: extract batch helpers createTestUsers, createTestMembershipsForUsers, createTestAttributeAssignments
Organize batch DB operations from createAttributesScenario into
reusable helper functions mirroring the existing single-record helpers.
Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>
* cleanup: remove unused single-record helpers and JSDoc comments
Remove createTestUser, createTestMemberships, createTestAttributeAssignment
(now replaced by batch versions). Remove added comments.
Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>
* chore
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent cc01d11 commit cfb1489
1 file changed
Lines changed: 115 additions & 78 deletions
File tree
- packages/features/routing-forms/lib
Lines changed: 115 additions & 78 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 56 | | |
93 | 57 | | |
94 | 58 | | |
| |||
122 | 86 | | |
123 | 87 | | |
124 | 88 | | |
125 | | - | |
126 | | - | |
127 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
128 | 108 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
137 | 181 | | |
138 | 182 | | |
139 | 183 | | |
| |||
167 | 211 | | |
168 | 212 | | |
169 | 213 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 214 | + | |
| 215 | + | |
182 | 216 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
188 | 221 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 222 | + | |
201 | 223 | | |
202 | | - | |
203 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
204 | 241 | | |
205 | 242 | | |
206 | 243 | | |
| |||
232 | 269 | | |
233 | 270 | | |
234 | 271 | | |
235 | | - | |
| 272 | + | |
236 | 273 | | |
237 | 274 | | |
238 | 275 | | |
| |||
0 commit comments