Didn’t knew [$ "prop"] used more resources and time than .prop. Replaced all of them on my autotile system and reduced the time from avg ~200ms to avg ~20ms.
Variables accessed with the dot operator have their hashes evaluated at compile time, but those accessed with the struct accessor have to have them evaluated at runtime
Edit: Struct lookups which can be determined at compile time now are, so there’s no difference between [$ “prop”] and .prop, but there still is for struct lookups from a variable.
← Return to Benchmark
Comments
Log in with itch.io to leave a comment.
Didn’t knew
[$ "prop"]used more resources and time than.prop. Replaced all of them on my autotile system and reduced the time from avg ~200ms to avg ~20ms.Amazing job!
Variables accessed with the dot operator have their hashes evaluated at compile time, but those accessed with the struct accessor have to have them evaluated at runtime
Edit: Struct lookups which can be determined at compile time now are, so there’s no difference between [$ “prop”] and .prop, but there still is for struct lookups from a variable.
Cool idea, thanks for making this!
great tool. Kind of upsetting how slow array_push is.
I’ve been asking them for ages to have it allocate memory in chunks the same way ds_list_add does, but it hasn’t happened yet
Update: it now has https://www.youtube.com/watch?v=C7UrZ7JpQe8