3 ms·
Doesn't .NET Native address startup perf, particularly for UWP applications? I'm guessing the reason why C++ yields lower memory usage than C#/.NET is because
by mwcampbell 11y ago
Doesn't .NET Native address startup perf, particularly for UWP applications?
I'm guessing the reason why C++ yields lower memory usage than C#/.NET is because RAII and reference counting ensure that memory is always freed as soon as it's no longer needed, whereas garbage collection only ensures that memory belonging to unused objects will be freed sometime later. Is that correct?
- pcwalton 11y agoAlso stack allocation and pervasive use of value types help C++ a lot in practice. This reduces overhead of heap metadata. There's also the overhead of .NET wrapper objects for OS resources--compare a .NET window object to an HWND, the latter of which is just a word-sized opaque ID describing a kernel managed resource. Though GC has its own advantages too--the ability to compact being the main one.
- Aleman360 11y agoHaven't seen any benchmarks but I'm guessing the baseline working set of a .Net Native UWP app is still megabytes bigger than a C++ UWP app. *edit: ~16 MB for .Net Native, ~10 MB for C++ using latest VS2015 targeting x86. Not going to matter for most apps, but for system UI that has to run on multi-user servers it does ;)