[Lldb-commits] [PATCH] Fix ValueObject::GetValueDidChange; Improve test for it
clayborg at gmail.com
Fri Mar 6 09:35:16 PST 2015
I believe this will cause serious performance issues. GetValueDidChange() is not trying to figure out if any children have changed, but if the current SBValue or ValueObject has changed. A structure with 1000000 items doesn't have a value itself, and there is no way we should be checking all 1000000 children and asking them if anything changed.
To clarify a few things that we consider when using ValueObjects/SBValue:
1 - an aggregate type has no value. These include structs, unions, classes, arrays, anything that contains multiple children. ValueDidChange should never say true for any of these as computing them based on visiting all children is too expensive. They might have summaries like "123 objects" for a std::vector<int>.
2 - pointers to aggregate types do have a value: the pointer itself. This can say it changed because it is very easy to calculate.
3 - simple types have values and can easily claim if they change or not
4 - synthetic types might also be very expensive and are a form of aggregate types. Imagine a synthetic child provider for std::map with a map that has 1000000 items inside it. We can **not** pay the cost of realizing all 1000000 children so we can set the value did change bit correctly. Stepping through a frame with an IDE that displays a variable whose type is std::map<A, B> would slow down stepping by a few minutes
So please do not commit this. I would suggest aborting this change.
More information about the lldb-commits