Commit 3d9d9f0
perf(modeling): replace concat with push in extrudeFromSlices
Replace O(n²) array concatenation pattern with O(n) push operations.
Each concat() creates a new array and copies all elements. In a loop
with N iterations, this results in O(n²) total copying. Using push()
with a for-loop avoids this overhead.
Uses for-loop instead of spread operator to avoid stack limits with
large polygon arrays (as noted by @hrgdavor in #1420).
Fixes #1419
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 52be9a1 commit 3d9d9f0
File tree
1 file changed
+14
-4
lines changed- packages/modeling/src/operations/extrusions
1 file changed
+14
-4
lines changedLines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
| |||
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
98 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
103 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
108 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
| |||
0 commit comments