Skip to content

Testing FFI Hot Loop Overhead – Java, C#, PHP, and Go

vancan1ty.com
3 pointsvancan1ty1 comment
On HN

Comments

If you want to use 'dotnet run' to quickly launch a C# program, you need to use '-c Release' when evaluating performance, otherwise it will target Debug. With that, you won't need <Optimize>true</Optimize> in .csrpoj and will get proper optimizations.

Additionally, you really want to use proper benchmarking frameworks for each respective language (BenchmarkDotNet for C#). Both JVM and .NET JIT will go through multiple optimization tiers, Tier 0 -> Tier 1 in case of .NET 7 and Tier 0 -> Tier 0/1 instrumented for collection of PGO data -> Tier 1 PGO optimized in case of .NET 8 (Dynamic PGO is opt-in in .NET 7 and opt-out in .NET 8).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.