nicoell / tm-editor-route

Editor Route Plugin for Trackmania 2020
MIT License
1 stars 0 forks source link

Inefficient draw-instances handling (E++ lines) #8

Open XertroV opened 1 month ago

XertroV commented 1 month ago

ATM the E++ draw instances pattern you use is 1 instance per route.

This is not really ideal, and I end up with stuff like this in my logs (these are dev only logs I think, so you might not see them).

The actual intention of draw instances is more like 1 per plugin, or one per purpose. Ideally, you would just push new points when a route was enabled / disabled. There is a path index thing to help you keep track of multiple paths, each part of a draw instance.

Part of the problem with this is the allocation method has some optimization for each draw instance, but not across all draw instances (since the assumption is that they'll be updated only when necessary, so reallocs or things won't be multiple times a frame).

There are probably some things I can do on the E++ side, but I have more pressing things atm.

image

XertroV commented 1 month ago

It's not a big deal ATM FWIW. Just wanted to mention b/c it does have some impact.

nicoell commented 1 month ago

I couldn't find time to look into this yet. Not sure I will soon, either. But I'll update here once I got to it and considered options.