Skip to content

Does Silk.net have more perfomance than C++? #752

Answered by Perksey
marredarre asked this question in General
Discussion options

You must be logged in to vote

Silk.NET is slower than if you were to use the APIs C++, because it's basically impossible to achieve equal or better performance due to C#'s runtime: managed-to-native (and vice versa) transitions are expensive (at least compared to a native-to-native call), and is completely unavoidable. However, in some cases you may benefit from .NET's JIT and its profile guided optimization, where it's able to detect code paths that aren't used often, and recompile the method at runtime to prioritise those that are.

But given C++ is a systems language (about as bare-metal as you can get), it is basically impossible to beat it with a managed language such as C#.

However C# is much nicer to use than C+…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@marredarre
Comment options

Answer selected by marredarre
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants