Some modern GML functions for various performance gains #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not sure if you're still maintaining this repository, but:
In the intervening years since this repository was last updated, GameMaker added some nice functional programming features such as array_reduce, array_map, etc. These [are a fair amount faster than doing the loops manually in GameMaker in both VM and YYC)[https://dragonite.itch.io/gmbenchmark] and can be used in a handful of places.
There are a few other places where these could be used but I didn't, since I'm not familiar with some of the advanced math functions and wouldn't know how to unit test them.
Additionally, there are a few new GML features that could be used for stylistic/readability reasons (
string_starts_with
in the ini functions and optional arguments, for instance) but I decided those were a question for another day.Lastly, in most places you seem to be caching the sizes of arrays before iterating over them, but there were a small number of loops that didn't do this, so I changed those over too.