# F# faster than C#?

**URL:** <https://forums.fsharp.org/t/f-faster-than-c/3506>\
**Category:** General\
**Created:** [January 12, 2024, 3:24am UTC](https://forums.fsharp.org/t/f-faster-than-c/3506 "2024-01-12T03:24:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![altbodhi](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/altbodhi/32/1253_2.png) [@altbodhi](https://forums.fsharp.org/u/altbodhi)\
**Post date:** [January 12, 2024, 3:24am UTC](https://forums.fsharp.org/t/f-faster-than-c/3506/1 "2024-01-12T03:24:42Z")

</div>

> F# gives you **simplicity** and **succinctness** like Python with **correctness** , **robustness** and **performance** beyond C# or Java.  
> This quote from home page. Is it really? I mean performance. I tested it (very simple processing lists for example sum items) but no times have faster than C#.

---

<div class="post-metadata">

**Author:** ![kevinmcfarlane](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/kevinmcfarlane/32/388_2.png) [@kevinmcfarlane](https://forums.fsharp.org/u/kevinmcfarlane)\
**Post date:** [January 15, 2024, 3:39pm UTC](https://forums.fsharp.org/t/f-faster-than-c/3506/2 "2024-01-15T15:39:17Z")

</div>

I don’t know. In general I dont see how it would be faster, but it may be down to language features for certain classes of problem.

The other day, I saw a video where, for scientific computing, an application was also ported to Rust with the help of an experienced Rust dev. Initially the Rust was twice as fast as the F#. But when he fixed up some defects in the F# it ended up being faster than Rust! However, there was only his word for it.

But I also recall hearing years ago of applications being rewritten from C++ to C# and being more performant as a result. It’s probably a bit misleading though, as no doubt, when you rewrite even in the same language you usually discover a better more efficient way of solving the problem. No doubt if they’d rewritten the C++ it would have been faster too.

---

<div class="post-metadata">

**Author:** ![murphy](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/murphy/32/1373_2.png) [@murphy](https://forums.fsharp.org/u/murphy)\
**Post date:** [January 17, 2024, 9:17am UTC](https://forums.fsharp.org/t/f-faster-than-c/3506/3 "2024-01-17T09:17:50Z")

</div>

With careful optimization, F# code can certainly compete with any other compiled language. It isn’t automatically faster than C#, of course, but the functional-first style has its advantages in multithreaded scenarios, for example.

If you want profiling data and example code, perhaps these are worth a look:

- [GitHub - praeclarum/1brc: 1️⃣🐝🏎️ The One Billion Row Challenge - .NET Edition](https://github.com/praeclarum/1brc)
- [https://fastfsharp.com/](https://fastfsharp.com/)
- [https://youtube.com/@FastFSharp?feature=shared](https://youtube.com/@FastFSharp?feature=shared)

---

<div class="post-metadata">

**Author:** ![altbodhi](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/altbodhi/32/1253_2.png) [@altbodhi](https://forums.fsharp.org/u/altbodhi)\
**Post date:** [January 21, 2024, 1:38pm UTC](https://forums.fsharp.org/t/f-faster-than-c/3506/4 "2024-01-21T13:38:28Z")

</div>

> **[1BRC in .NET among fastest on Linux: My Optimization Journey](https://hotforknowledge.com/2024/01/13/1brc-in-dotnet-among-fastest-on-linux-my-optimization-journey/)**
>
> How I optimized my 1BRC solution step-by-step and why .NET is great for high-performance code

---

<div class="post-metadata">

**Author:** ![dlidstrom](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/dlidstrom/32/421_2.png) [@dlidstrom](https://forums.fsharp.org/u/dlidstrom)\
**Post date:** [March 24, 2025, 9:46pm UTC](https://forums.fsharp.org/t/f-faster-than-c/3506/5 "2025-03-24T21:46:56Z")

</div>

Developer performance might be better with F#. But anyway who cares about a few percent perf diff? That’s extremely rarely important to me.
