Jase00 I like containers, but how do you use them? I mean to say, how do you afford to not have everything in families?
Many times I want to drop things in containers, but then you lose the benefits of a family.
Common problems for me would be something like, All entities need collision handling so they go in a family. Then I can put particular entityA with the appropriate view model in a container, but all the big logic is in the family and has no access to that relationship. Then I realize I need a family for the view models because they all need to handle animations and frame settings and effects, and now my container is broken. I haven't checked if hierarchies can side step the picking problem, as so far I have only used them for compound environments or view models.
---
As far as function overhead goes, it really isn't a big deal in 90% of cases. A simple test where you compare setting a variable in a function compared to doing the same outside of one gives you the basic overhead difference. Adding parameters increases the overhead as well. Again, not a big deal if you wrap 10 events in a function, as the per event cost decreases, but loops obviously multiple this cost.
Again, probably not a reasonable concern for most projects.
But if you structure a project to have everything in functions, and have a lot of needed utility functions for basic stuff (like vector math or other stuff), you pay dearly for it. Which again is tolerable in alot of projects. If I recreated Nes mario3, with copious functions and custom actions, down to simulating specific nes style subpixel movement and screenline rendering, I would still be cruising at a perfectly comfortable performance with room to run the game multiple times over and tipple the on screen badguy count.
So like Ashley said, it isn't actually a big deal as most projects have other limitations long before function overhead is a concern, and the only improvement that could happen to functions that I can figure, is that we could have a special type that inlines it's contents at runtime (basically copy pasting its contents). That improvement would be useful for utility functions (like dot product, or add score), but it wouldn't work for dynamically routed functions- meaning half of my function calls still wouldn't benefit. You could think of inline functions as simply as putting a CONST place holder for a specific set of subevents that get placed there instead of a function call when you run the project.
Since I rely on alot of trig functions that aren't included in c3 math expressions, these functions get called thousands of times per tick. The overhead of the function call itself, typically with a minimum of 4 parameters, ends up being more costly than all the sqrts being calculated. Moving these utilities to a plugin/behavior improves performance by more than 7x in that category; Which is alot in the end, but only because my project spends a huge amount of cpu on 3 things: 1. collisions, 2. function wrapped math, 3. function driven dynamic routing for modular behavior.
Since a good 20% of my performance is based on shoving numbers around, taking it out of functions saved me around 17% cpu time, which is definitely worth it, for me, but only because I am trying to really push the object count.
I've done other dumb tests for things like character input buffers - like if I store most data for an instance in an array, I simplify my event sheet and logic, but I have to use foreach loops to iterate the data. If I manually go over instance variables, I can save maybe 50% the processing time, but as this accounts for a much smaller percentage of overall performance, do I care? Well, unfortunately yes, but only because I am literally trying to see just how many thousands of complex entities I can have. But, so far those are all dumb entities. Adding in ai that requires basic information about its surroundings will quickly ellipse the performance gained by avoiding an array. Pretty soon that 2.5 overall performance increase becomes 0.025, and you wasted alot of time being an idiot about performance that didn't matter (this is me 90% of the time).
TLDR The only issue I have had with function overhead is while trying to simulate dozens of characters with 100s of bullets all needing to calculate vector normals and projections, all looping 1000s of times over small functions that could be inlined.