(iterations: number)
| 368 | // should take around <100ms for 10K iterations (@dwelle's PC 22-05-25) |
| 369 | it.skip("normalizeElementsOrder() perf", () => { |
| 370 | const makeElements = (iterations: number) => { |
| 371 | const elements: ExcalidrawElement[] = []; |
| 372 | while (iterations--) { |
| 373 | const container = API.createElement({ |
| 374 | type: "rectangle", |
| 375 | boundElements: [], |
| 376 | groupIds: ["B", "A"], |
| 377 | }); |
| 378 | const boundText = API.createElement({ |
| 379 | type: "text", |
| 380 | containerId: container.id, |
| 381 | groupIds: ["A"], |
| 382 | }); |
| 383 | const otherElement = API.createElement({ |
| 384 | type: "rectangle", |
| 385 | boundElements: [], |
| 386 | groupIds: ["C", "A"], |
| 387 | }); |
| 388 | mutateElement(container, { |
| 389 | boundElements: [{ type: "text", id: boundText.id }], |
| 390 | }); |
| 391 | |
| 392 | elements.push(boundText, otherElement, container); |
| 393 | } |
| 394 | return elements; |
| 395 | }; |
| 396 | |
| 397 | const elements = makeElements(10000); |
| 398 | const t0 = Date.now(); |
no test coverage detected
searching dependent graphs…