ivailo91 wrote:
I don't know if this is the right place to ask, but...
As I look at the Box2DX source code, I'm just wondering, there are so many functions that accept for example Vector2 parameters. These functions don't actually modify the Vector2's or anything, but yet they don't use the ref keyword. A simple observation can point you that there is significant speedup with ref's even with so simple types...
1) if they don't modify the values why the need for ref ?
2) In my bench tests, using by value is slightly faster over a million iterations, this is OK for Vector2 as the size of it fits in well how the IL works, anything lower than 16-24 bytes (can't remember which) should have no performance difference than by passing by value or ref, I'd like to see proof otherwise to which you came to your conclusions or a citation to your observation, C++ != c# so don't assume they work the same way when passing by ref.
ivailo91 wrote:
If the guys who port this thing to C# aren't concerned with speed than the port is worth nothing...
This is stupid in itself as the performance is not only fine, but if it's slightly slower than its C++ equivalent and you are so worried then maybe you shouldn't be using c#, if anything its useful for creating tool to generate the data needed and that's if the performance wasn't quick enough, which it is.
So if you think this port is worth nothing to you, fair enough, the code's there to do a better one, I guess for the rest of us, it's worth more than nothing.
EDIT: you can also change from structs to classes if you think it will make a difference.