Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is nothing intrinsic that makes one language faster than the other. They both run on the CLR and hence have roughly the same performance characteristics of any language that runs on the CLR. There are features of the respective languages though that do affect performance.</p> <p>Tail recursion is a great example. If you write an F# app which heavily uses tail recursion, the compiler will attempt to rewrite it as an iterative loop removing the recursion penalty. Additionally F# uses the .tail IL op code in order to ask the CLR to remove the recursion stack penalty where possible. </p> <p>It's easy to demonstrate this by translating some F# continuation samples to C# and then insert huge data sets. F# will work and C# will eventually crash.</p> <p><a href="http://blogs.msdn.com/jaredpar/archive/2008/11/13/comparing-continuations-in-c-and-f-part-3-double-wrong.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/jaredpar/archive/2008/11/13/comparing-continuations-in-c-and-f-part-3-double-wrong.aspx</a></p> <p>But that is not necessarily a deficiency in C#. C# is not meant to be written with continuations while that is certainly the case in F#. It's in fact not surprising that writing algorithms meant for F# in C# produce not so great results.</p> <p>Conversely, C# iterators are usually more efficient than F# sequence expressions. The reason is that C# iterators are very efficient state machines vs. F#'s are continuation passing. </p> <p>In general though, in the abscence of threads, if you use the languages as they are intended to be used they will have similar performance characteristics. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload