frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Unity's Mono problem: Why your C# code runs slower than it should

https://marekfiser.com/blog/mono-vs-dot-net-in-unity/
51•iliketrains•2h ago

Comments

makotech221•1h ago
Yeah I think Unity just doesn't have the technical skillset anymore to make the migration to coreclr. It keeps getting delayed and their tech leads keep dropping out.

Might I suggest https://github.com/stride3d/stride, which is already on .net 10 and doesn't have any cross-boundary overhead like Unity.

WillPostForFood•52m ago
Progress has been painfully slow, but Unity does seem to be moving forward.

Unity updates on their plans and progress:

2022 - officially announced plans to switch to CoreCLR - https://unity.com/blog/engine-platform/unity-and-net-whats-n...

2023 - Tech update - https://unity.com/blog/engine-platform/porting-unity-to-core...

Unite 2025 - CoreCLR based player scheduled for Unity 6.7 in 2026 - https://digitalproduction.com/2025/11/26/unitys-2026-roadmap...

teraflop•32m ago
Maybe they are making progress. But given that they first started talking about this in 2018, and then in 2022 they announced that they were planning to release a version with CoreCLR in 2023, and then in 2024 they said it would be in beta in 2025, and now in 2025 they're planning to release it as a technical preview in 2026, but they're still talking about an "internal proof-of-concept" as though it's something coming in the future...

As an outsider, it certainly seems like there's reason for skepticism.

bentt•22m ago
Nice link, thanks.
999900000999•51m ago
Stride has a fraction of the features as unity.

Godot is the only real open source competitor, their C# support is spotty. If I can't build to Web it's useless for game jams as no one should be downloading and running random binaries.

A real sandbox solution with actual GPU support is needed.

eole666•36m ago
Godot 4 C# web export is coming soon : https://github.com/godotengine/godot/pull/106125
999900000999•27m ago
We'll see when it actually ships.

I've seen this issue before, they're making progress but theirs no firm release date.

Plus you then have to extensive testing to see what works in Web builds and what doesn't. I REALLY enjoy vibe coding in Godot, but it's still behind Unity in a lot of ways.

Rochus•59m ago
That's interesting. I made measurements with Mono and CoreCLR some years ago, but only with a single thread, and I came to the conclusion that their performance was essentially the same (see https://rochus.hashnode.dev/is-the-mono-clr-really-slower-th...). Can someone explain what benchmarks were actually used? Was it just the "Simple benchmark code" in listing 1?
eterm•31m ago
What's going on with the Mandelbrot result in that post?

I don't beleive such a large regression from .NET framework to CoreCLR.

to11mtm•15m ago
NGL would be nice if there was a clear link to the cases used both for OP as well as who you are replying to... Kinda get it in OP's case tho.
to11mtm•21m ago
I think a lot of the devil is in the details, especially when we look at NET8/NET10 and the various other 'boosts' they have added to code.

But also, as far as this article, it's noting a noting a more specific use case that is fairly 'real world'; Reading a file (I/O), doing some form of deserialization (likely with a library unless format is proprietary) and whatever 'generating a map' means.

Again, this all feels pretty realistic for a use case so it's good food for thought.

> Can someone explain what benchmarks were actually used?

This honestly would be useful in the article itself, as well as, per above, some 'deep dives' into where the performance issues were. Was it in file I/O (possibly Interop related?) Was it due to some pattern in the serialization library? Was it the object allocation pattern (When I think of C# code friendly for Mono I think of Cysharp libraries which sometimes do curious things)? Not diving deeper into the profiling doesn't help anyone know where the focus needs to be (unless it's a more general thing, in which case I'd hope for a better deep dive on that aspect.)

Edited to add:

Reading your article again, I wonder whether your compiler is just not doing the right things to take advantage of the performance boosts available via CoreCLR?

E.x. can you do things like stackalloc temp buffers to avoid allocation, and does the stdlib do those things where it is advantageous?

Also, I know I vaguely hit on this above, but also wondering whether the IL being done is just 'not hitting the pattern'. where a lot of CoreCLR will do it's best magic if things are arranged a specific way in IL based on how Roslyn outputs, but even for the 'expected' C# case, deviations can lead to breaking the opt.

calebh•57m ago
Will the move to CoreCLR give any speed ups in practice if the release build is complied with IL2CPP anyway? On all the games that I've worked on, IL2CPP is one of the first things that we've enabled, and the performance difference between the editor and release version is very noticeable.
Rohansi•20m ago
Editor is slower than Mono release builds. You'll need to compare Mono release vs. IL2CPP release to see the actual difference.
Rohansi•53m ago
The article doesn't cover it but the GC being used by Unity also performs very poorly vs. .NET, and even vs. standalone Mono, because it is using the Boehm GC. Last I heard Unity has no plans to switch IL2CPP to a better GC [1].

It'll be interesting to see how the CoreCLR editor performs. With that big of a speed difference the it might be possible for games to run better in the editor than a standalone Mono/IL2CPP build.

[1] https://discussions.unity.com/t/coreclr-and-net-modernizatio...

Rochus•50m ago
> because it is using the Boehm GC

For what reason? Mono has a pretty good precise GC since many years.

Rohansi•28m ago
Yes, SGen should be a lot better, but Unity cannot use it because they hold and pass raw pointers around everywhere. That's fine for Boehm but not possible with SGen. They're working on fixing this already but not sure why they aren't planning a move to a better GC.
llmslave2•44m ago
Re. the editor speedup, it should outright eliminate the "domain reload" thingy that happens because all of the C# needs to be unloaded and reloaded in response to a change.
Rohansi•26m ago
Pretty sure that will still be there? It'll be different because CoreCLR doesn't really have AppDomains but it will still need to unload old assemblies and reload them all again. That's the only reliable way to reset everything into a clean state.
llmslave2•22m ago
But only the assemblies that changed right? Or would it still be all of them?
Inityx•37m ago
Very obvious AI writing
llmslave2•35m ago
You think? Seems human to me...
sieep•8m ago
I recently started learning Godot and learning that they use .NET for the C# runtime is a nice touch. I write a lot of code that targets .NET in my day job, so having to learn the unity way of doing things would be frustrating.

Playing with Turmites: better than crypto/rand?

https://blog.vrypan.net/2025/12/28/playing-with-turmites-better-than-crypto-rand/
2•vrypan•3m ago•1 comments

Apple retires 25 products, ends iconic iPhone SE era

https://news.az/news/apple-retires-25-products-ends-iconic-iphone-se-era
2•doener•3m ago•0 comments

Curator 'shocked' by Melbourne pitch performance in Ashes

https://www.rnz.co.nz/news/sport/582828/curator-shocked-by-melbourne-pitch-performance-in-ashes
2•tigerlily•11m ago•0 comments

ThinkTank, an "idea processor" that launched a religion (of outliners)

https://stonetools.ghost.io/thinktank-dos/
2•ChristopherDrum•17m ago•0 comments

Shields.io Uses the GitHub API

https://shields.io/blog/token-pool
2•angristan•18m ago•0 comments

Show HN: DeviceGPT – AI-powered Android device monitor with real data

1•teamzlab•18m ago•0 comments

The brain decides what to remember with sequential molecular timers

https://medicalxpress.com/news/2025-11-brain-reveals-sequentially-molecular-timers.html
1•PaulHoule•24m ago•0 comments

The Question Nobody Asks

https://aliveness.kunnas.com/articles/the-question-nobody-asks
1•ekns•24m ago•0 comments

Multi-Tenant SaaS's Wildcard TLS: An Overview of DNS-01 Challenges

https://www.skeptrune.com/posts/wildcard-tls-for-multi-tenant-systems/
1•skeptrune•25m ago•0 comments

Fast Cvvdp Implementation in C

https://github.com/halidecx/fcvvdp
2•todsacerdoti•28m ago•0 comments

The Sociology of the Crease

https://www.sebs.website/blog/the-sociology-of-the-crease
2•Incerto•31m ago•0 comments

Show HN: SecureNow – Security Fixes You Can Apply Today

https://www.securenow.dev
1•pelmenibenni•34m ago•0 comments

How to Complain

https://outerproduct.net/trivial/2024-03-25_complain.html
3•ysangkok•34m ago•1 comments

How to never make a bad decision

https://docs.google.com/document/d/1Ni9EOFM4-rADFT-cJHKUJUod8408zPk4zE-6IIHB4kU/edit?usp=sharing
1•PhilosophyForAI•38m ago•1 comments

Release age v1.3.0: post-quantum (and more)

https://github.com/FiloSottile/age/releases/tag/v1.3.0
1•birdculture•38m ago•0 comments

CEOs are hugely expensive. Why not automate them?

https://www.newstatesman.com/business/companies/2023/05/ceos-salaries-expensive-automate-robots
71•nis0s•41m ago•40 comments

Rethinking Tools in MCP

https://cra.mr/rethinking-the-definition-of-tools-in-mcp/
1•jshchnz•41m ago•0 comments

Spherical Cow

https://lib.rs/crates/spherical-cow
8•Natfan•46m ago•1 comments

Show HN: Golazo – Live soccer updates in your terminal

https://github.com/0xjuanma/golazo
2•rocajuanma•47m ago•0 comments

Slaughtering Competition Problems with Quantifier Elimination

https://grossack.site/2021/12/22/qe-competition.html
6•todsacerdoti•48m ago•0 comments

Airlines call in psychologists to stop passengers risking their lives for bags

https://www.telegraph.co.uk/business/2025/12/27/airlines-call-psychologists-passengers-risking-li...
2•elsewhen•48m ago•1 comments

62 years in the making: NYC's newest water tunnel nears the finish line

https://ny1.com/nyc/all-boroughs/news/2025/11/09/water--dep--tunnels-
22•eatonphil•52m ago•3 comments

Show HN: Upload a song and get a finished music video (no editing, no prompts)

https://musicvideogenerator.app/
2•hexadecimal•56m ago•1 comments

Halifax video game workers form first Ubisoft union in North America

https://www.cbc.ca/news/canada/nova-scotia/ubisoft-forms-first-union-north-america-halifax-9.7028674
3•cf100clunk•59m ago•0 comments

Two strangers. A terrorist bomb. An extraordinary tale of courage

https://bungalow-magazine.com/p/the-bench-2f5e
1•rmason•1h ago•0 comments

Show HN: Thingo

https://thingoboard.com
1•jryan49•1h ago•0 comments

As AI gobbles up chips, prices for devices may rise

https://www.npr.org/2025/12/28/nx-s1-5656190/ai-chips-memory-prices-ram
20•geox•1h ago•8 comments

Boost.MultiIndex Refactored

http://bannalia.blogspot.com/2025/12/boostmultiindex-refactored.html
1•ibobev•1h ago•0 comments

Mercury: The planet that shouldn't exist

https://www.bbc.com/future/article/20251223-mercury-the-planet-that-shouldnt-exist
1•1659447091•1h ago•0 comments

Why Your AI Characters Turn To Mush (and how I fixed it)

https://ghostintheweights.substack.com/p/why-your-ai-characters-turn-to-mush
2•llamataboot•1h ago•1 comments