avoid extra loops when terrain does not exist#2304
Conversation
|
@HarelM any suggestions? |
|
I don't know what this was for unfortunately, maybe @prozessor13 remembers. |
|
After a quick look into the code, because i cannot remember, i think the whole Regards. |
|
Thanks for the quick response @prozessor13! |
|
I think its sufficient to switch on collision-boxes, and visually check if they have the right positions. On the other side there exists render-tests which would fail if something goes wrong. |
|
@zhangyiatmicrosoft I think the best approach is to do what @prozessor13 suggested. |
Thank you all. Deleted the block. |
Launch Checklist
placeSymbol is a very hot code path if not the hottest. For most screen sizes, this function is called 1000 to 2000 times.
When terrain does not exist, it is still doing a loop on 4-element array ['textBox', 'verticalTextBox', 'iconBox', 'verticalIconBox'] which means 4000 to 8000 extra loops.
Please review --- before my change, textBox had elevation of 0, and now it would be undefined.
However, I cannot find anywhere the elevation of textBox is used for placement or collision. The previous code was added in #1022, @HarelM @prozessor13, can you share more insights regarding where and how it is used?
There is no UT coverage either.