Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualTelastyn

Posted 29 December 2012 - 09:09 PM

Enh, that code wouldn't be uglier in C#. You would still have the structs for device/command and still have the array for the variable behavior. The issue would be that C# delegates don't have the same performance characteristics as the function pointer, meaning you don't gain your cache benefits.

That said, that sort of virtual dispatch optimization is right in the wheelhouse for things that JIT'ed languages can optimize that C++ can't.

#1Telastyn

Posted 29 December 2012 - 09:08 PM

Enh, that code wouldn't be uglier in C#. You would still have the structs for device/command and still have the array for the viable behavior. The issue would be that C# delegates don't have the same performance characteristics as the function pointer, meaning you don't gain your cache benefits.

That said, that sort of virtual dispatch optimization is right in the wheelhouse for things that JIT'ed languages can optimize that C++ can't.

PARTNERS