While working on this thread I noticed a weird performance issue that never noticed before. This happens from Max 2016 to Max 2024.
Why is the performance much better when renaming the nodes after the whole creation?
(
delete objects
gc()
st=timestamp(); sh=heapfree
for j = 1 to 5000 do
(
a = box()
a.name = "b"
)
format "time:%ms heap:%\n" (timestamp()-st) (sh-heapfree)
delete objects
gc()
st=timestamp(); sh=heapfree
for j = 1 to 5000 do box name:"b"
format "time:%ms heap:%\n" (timestamp()-st) (sh-heapfree)
delete objects
gc()
st=timestamp(); sh=heapfree
for j = 1 to 5000 do box()
for j in objects do j.name = "b"
format "time:%ms heap:%\n" (timestamp()-st) (sh-heapfree)
delete objects
gc()
)
Max 2016
time:2003ms heap:1354600L
time:2172ms heap:5395528L
time:486ms heap:1354600L
Max 2024
time:2418ms heap:1146616L
time:2776ms heap:5326348L
time:601ms heap:1146584L