Which is most optimised?

BlitzMax Forums/BlitzMax Programming/Which is most optimised?

anyone care to explain why passing a large type vs a small type to a function is slower? A type is just a reference (pointer) to some memory location of where the actual data for the type is.

No one said it was, did they? I Know I didn't.

Also why would reading fields from a type be any slower based on the size of the type? Offsets to fields I don't recall are computed iteratively [unless done at compile time].

I didn't say that they were, I said that they might be. My thinking being that there are a limited number of registers available to the CPU and the more fields you have, the less chance of the fields you want being in those registers. Of course, this presumes a level of optimization which might not be present in the first instance, so it may well be that there is no speed difference because they're both slow ( relatively speaking. )

Your example isn't exactly what I would call a big type. When I said a big type, I had in mind something at least 10-20 times the size of that.