Commit 09ee79b
authored
Improve memory cleanup performance (#506)
# Why?
The memory cleanup routine would resort on every run, this is quite
expensive to do during frame generation time. Instead keep a list of
orphaned textures, once we need to clean up pick the first one added to
that list until we reach our threshold using a simple while loop.File tree
5 files changed
+50
-47
lines changed- examples/tests
- src/core
- textures
5 files changed
+50
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| 182 | + | |
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
| |||
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
211 | | - | |
| 213 | + | |
212 | 214 | | |
| 215 | + | |
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
| |||
387 | 390 | | |
388 | 391 | | |
389 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
390 | 397 | | |
391 | 398 | | |
392 | 399 | | |
393 | 400 | | |
394 | 401 | | |
395 | 402 | | |
396 | 403 | | |
| 404 | + | |
| 405 | + | |
397 | 406 | | |
398 | 407 | | |
399 | 408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
164 | 195 | | |
165 | 196 | | |
166 | 197 | | |
| |||
193 | 224 | | |
194 | 225 | | |
195 | 226 | | |
196 | | - | |
| 227 | + | |
197 | 228 | | |
198 | 229 | | |
199 | 230 | | |
| |||
206 | 237 | | |
207 | 238 | | |
208 | 239 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
251 | 248 | | |
252 | 249 | | |
253 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | 173 | | |
176 | 174 | | |
177 | 175 | | |
| |||
210 | 208 | | |
211 | 209 | | |
212 | 210 | | |
213 | | - | |
214 | 211 | | |
215 | 212 | | |
216 | 213 | | |
| |||
219 | 216 | | |
220 | 217 | | |
221 | 218 | | |
222 | | - | |
223 | 219 | | |
| 220 | + | |
224 | 221 | | |
225 | 222 | | |
226 | 223 | | |
| |||
0 commit comments