Fast intersection of sets: C++ vs C#

后端 未结 13 1668
野性不改
野性不改 2020-12-28 10:17

On my machine (Quad core, 8gb ram), running Vista x64 Business, with Visual Studio 2008 SP1, I am trying to intersect two sets of numbers very quickly.

I\'ve impleme

13条回答
  •  醉酒成梦
    2020-12-28 10:53

    Ok, after much feedback I've updated the original question a number of times:

    • The tests are now each run 1,000 times
    • The C# code now uses a higher resolution timer
    • The data structures are now populated BEFORE the tests

    The result of this so far is that C# is still ~5x faster than C++.

    Thanks everyone for your ideas/suggestions.

提交回复
热议问题