Your test includes things like comparing adding 1 to a variable to adding 1 to a variable in a function. That's exactly the kind of a test that basically just measures the overhead of a function. Functions already pretty much do the minimum work they can do, I'm not sure there's any obivous way to speed them up, but that's not to say they're slow. But I guess you might want to avoid them in long loops and such.
For sure, I was basically looking at function overhead, comparing using functions vs not using them. I was curious though... would there be a way to create event sheet references? Sometimes a function only makes sense from a readability people thinking sort of way if that makes sense. Sometimes functions make sense from a program design standpoint. Would there be a way to have event sheet functions that are only in the event sheet?
For example:
If (object.A overlaps Family.Tilemaps) && (object.A.bool == Family.Tilemaps.bool)
----Do this, do that, push out of solids, bla, bla, bla, bla.
If (object.A overlaps Family.SolidBlocks) && (object.A.bool == Family.SolidBlocks.bool)
----Do this, do that, push out of solids, bla, bla, bla, bla 20 actions.
If (object.A overlaps Family.MobileBlocks) && (object.A.bool == Family.MobileBlocks)
----Do this, do that, push out of solids, bla, bla, bla, bla.
REpeat for a few more condistions
The above can be split into functions, and is preferable for readability and making changes to what happens, But in a game with many itterations through this, the function adds overhead. Whats more the function isn't needed, just a convenience for later editing. If there was an editor side function that could be called that would inline the events on export so that no overhead was created, that would be preferable.
At the same, the only reason this pattern exists is because there are no combo or/ands in a condition tree. But that is a separate topic. (why is this?)
for example : (A over B && A.x == b.x) || (A over C && A.x == C.x) || so on...