This article demonstrates why generational GC with a bump-allocating nursery is so important. Without a semispace copying collector (which is usually impractical without a generational GC) you can't have bump allocation at all . Not having that fast path is a huge performance loss, as this article demonstrates.
Allocation is cheap in .NET until it is not
11–20 of 67 posts
Re: Allocation is cheap in .NET until it is not
#12Is there work ongoing or planned to try to add/improve escape analysis, as the article suggests?
Re: Allocation is cheap in .NET until it is not
#13Earlier quoted context omitted.
This pattern was also used by Java and .NET for implementing cheap String.substring calls where all substrings would use the same underlying array with just offsets changed. Unfortunately it turns out that people read entire files into a one big String and then have a reference to just a small piece of it (via substring) marking the big underlying array as reachable for the GC holding a lot of memory for no reason. T…
I know this was changed recently-ish in Java, but I hadn't heard of anybody doing the old substring trick in .NET, do you know when they cut over?
Re: Allocation is cheap in .NET until it is not
#14This brought memories of that pattern (flyweight?) where the data was stored outside the objects, possibly in an array. An object was instantiated only to hold an index to the array position and allow access. That's dirty cheap!
Re: Allocation is cheap in .NET until it is not
#15Is there work ongoing or planned to try to add/improve escape analysis, as the article suggests?
Re: Allocation is cheap in .NET until it is not
#16Earlier quoted context omitted.
This pattern was also used by Java and .NET for implementing cheap String.substring calls where all substrings would use the same underlying array with just offsets changed. Unfortunately it turns out that people read entire files into a one big String and then have a reference to just a small piece of it (via substring) marking the big underlying array as reachable for the GC holding a lot of memory for no reason. T…
I know this was changed recently-ish in Java, but I hadn't heard of anybody doing the old substring trick in .NET, do you know when they cut over?
Re: Allocation is cheap in .NET until it is not
#17This article demonstrates why generational GC with a bump-allocating nursery is so important. Without a semispace copying collector (which is usually impractical without a generational GC) you can't have bump allocation at all . Not having that fast path is a huge performance loss, as this article demonstrates.
Re: Allocation is cheap in .NET until it is not
#18This article demonstrates why generational GC with a bump-allocating nursery is so important. Without a semispace copying collector (which is usually impractical without a generational GC) you can't have bump allocation at all . Not having that fast path is a huge performance loss, as this article demonstrates.
Re: Allocation is cheap in .NET until it is not
#19Is there work ongoing or planned to try to add/improve escape analysis, as the article suggests?
In general - yes: https://github.com/dotnet/coreclr/issues/1784 . However, nothing more specific I can say...
Re: Allocation is cheap in .NET until it is not
#20This article demonstrates why generational GC with a bump-allocating nursery is so important. Without a semispace copying collector (which is usually impractical without a generational GC) you can't have bump allocation at all . Not having that fast path is a huge performance loss, as this article demonstrates.
Mark-sweep-compact is another GC algorithm that supports bump allocation, and doesn't have the 2x overhead of semispace.