Wasting performance

With the new LOD system in MSFS 2024 I did notice that more users are using the LOD Creator tool of ModelConverterX as well to add levels of details to their models. So this triggered me to look at a number of issues and feature requests for the LOD Creator that were still on the TODO list.

The first one I looked at is the performance of the LOD Creator. When using a complex object with many triangles it takes a lot of time to calculate the LOD. So I used a profiler this time to have a look which steps of the algorithms take most time. And as usual, it is not where you think the complexity should be of course. The vertex clustering LOD creator was for example wasting a lot of time by updating the slider in the editor user interface at a much too high rate.

In my mind it was not that long ago that I implemented these algorithms, but it turns out that it was 15 years ago already. And I must say that in those 15 years I did learn quite a bit more about programming as well. So the code that I made back then did not look that good anymore with my current standards. I thus took some time to cleanup the code and structure it better.

The results of this are quite stunning if you ask me. An object with 8000 triangles took just over 90 seconds with the old code to calculate a new LOD. After all the changes I have made now it takes less than 2 seconds. Sometimes it is impressive how much performance you can waste in places where you don’t expect it. These performance improvements will be part of the next development release.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.