callidaria / stroemungsabriss

euroshmup
1 stars 0 forks source link

Improve Vector Insertions #268

Closed callidaria closed 2 months ago

callidaria commented 7 months ago

those long push_back chains that appear all over the codebase?

those are slow as hell, can be significantly improved by using insert -> this will stop repeated reallocations and replace them with a single one.

NOTE: this obviously does not include singular push_backs due to basic logic a 5 year old understands TODO: benchmark further how much and what impact insert has when doing smaller push_back chains (e.g. n=2,n=3) and then decide what to refactor and what is better left unaltered