-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chunk large ResizeArrays in TcResultsSinkImpl so that they aren't promoted to the Large Object Heap #6127
Comments
Hey @baronfel, I was looking at this and was just confused on few things, not withstanding the point that arrays should probably not be getting this big, can you explain the chunking benefit on an already large array? Reason I am asking it that the initial Resize array ... that is presumably already too big (and therefore on the LOH) is a problem, most of the operation on the resize arrays in TcResultsSinkImpl are mutating the existing array, not copying, (copy in Is this just a less optimal application of the post-built array chunking or have I missed something critical? I would have thought using an unrolled linked list here would have maybe been better as it chunks automatically as it grows, does not need to be copied (potentially), and is nearly as performant as array? |
The thing that worried me was that |
I get that it's a way to do it for copies, but in the example where it's implemented, the Thanks for help understanding this … the code structure here looks strange to me so I may need some educating or the code may need fixing, its a win-win either way for me 👍 |
I think we're speaking past each other: the intent was to change the declaration of So all in all I agree with you, |
Thanks for clarifying, I was referencing usage in PR Unlike linked list, an unrolled linked list can more dynamically handle additions and removable, ironically making it a better candidate for these operations then linked list or array, each array node can be made a variable length, unaffecting nodes around it so that predicate removal is faster … allowing this feature prevents blind index hopping down the array nodes. Additions are simply just adding to the array in the head node until overflow size hit for chunking so straight forward also. I was wondering if having the elements sorted by range in the array would help given the predicate is range based, but as it appears to happen infrequently, it will only add time sorting the insertions. |
oh yeah, #6084 was really just a very short-term get-something-done fix. This issue is the right place to do a proper long-term fix, and it sounds like that would be a good candidate. Then once the source data was converted, the changes would flow naturally to the TcSymbolUseData and other consumers 👍 |
Cool … time is running out so I'll try hack out before the weekend, so we can use in most places LOH is being hit, where it's an option ... these changes kinds of changes tend to propagate breaks like a weed so hopefully it's not too much of a mess. |
I haven't seen this pop up elsewhere, but given that this is kind of a game of whack a mole, it's likely that we have more LOH allocations sourced from this same data. Finding a way to use it uniformly throughout the codebase is likely to be a boon. |
I'm going to close out this specific issue, as @TIHan did so much work in this area in 2020-21. |
Following on from #6084 we should handle the cases where the unbounded
ResizeArrays
inTcResultsSinkImpl
(and potentially elsewhere?) are changed to be a list-like data structure that self-chunks its elements into arrays that are below the LOH threshold.Then we need to use that structure in place of at least the
capturedNameResolutions
member ofTcResultsSinkImpl
, potentially more.Per @TIHan in #6089 the structure doesn't have to be threadsafe as the compiler service thread is the only accessor.
The text was updated successfully, but these errors were encountered: