From my experience this kind of number crunching is where you'll expose the worst Java/C# performance because each operation is tiny, meaning ANY overhead is quite significant. i.e. running a very tight loop with not much happening inside.
It is interesting that it doesn't optimise better, unless the underlying data structures/objects have extra safety-code running perhaps? I don't know what algorithms are used, I wouldn't bet C# and C++ use exactly the same for all collections/algorithms though. No doubt one can find out, though with STL it is implementation-specific IIRC.
It is interesting that it doesn't optimise better, unless the underlying data structures/objects have extra safety-code running perhaps? I don't know what algorithms are used, I wouldn't bet C# and C++ use exactly the same for all collections/algorithms though. No doubt one can find out, though with STL it is implementation-specific IIRC.
Comment