VWR-24312: Massively duplicated objects (part 2)
Review Request #81 - Created Jan. 14, 2011 and submitted
Aleric Inglewood | Reviewers | ||
viewer | |||
VWR-24312 | |||
None | viewer-development |
Turns out that most of my SNOW-800 patch was included in Viewer 2 (albeit without crediting me). However, not everything was used and some more cleaning up was possible. After this patch, and when compiling with optimization, there are no duplicates left anymore that shouldn't be there in the first place: apart from the debug stream iostream guard variable, there are several static variables with the same name (r, r1, r2, etc) but that indeed actually different symbol objects. Then there are a few constant POD arrays that are duplicated a hand full of times because they are accessed with a variable index (so optimizing them away is not possible). I left them like that (although defining those as extern as well would have been more consistent and not slower; in fact it would be faster theoretically because those arrays could share the same cache page then).
Compiled with optimization and then running readelf on the executable to find duplicated symbols.
Posted (Jan. 14, 2011, 1:31 p.m.)
-
indra/llcharacter/llanimationstates.cpp (Diff revision 1) -
If all these lines are touched anyway, (didn't select all, to avoid an unnecessary long review), please either remove the alignment or use spaces instead of tabs for aligning, so they will look nice independent of tab display length.
-
indra/llcommon/lllslconstants.h (Diff revision 1) -
Yay for having type modifiers after the core type name. Makes them much easier to understand, especially when there are several cascaded ones. :-)
Review request changed
Updated (Jan. 16, 2011, 5:53 a.m.)
-
- added Diff r2
Changed tab's into spaces in the part that Boroondas pointed out (in indra/llcharacter/llanimationstates.cpp).
Posted (Jan. 20, 2011, 10:57 p.m.)
I fail to see how any of those changes "massively prevents object duplication". I don't disagree with any of them but I don't see much value in any either. Sure, there are different ways to skin a cat and some are better. Still, these changes will likely make upcoming merges conflict annoyingly and make the life of the maintainers (i.e. mine and Oz) horrid. It reminded me of this post by another (more famous) Open Source maintainer: http://tirania.org/blog/archive/2010/Dec-31.html
Posted (Jan. 31, 2011, 6:44 p.m.)
@Aleric: OK, you convinced me on all accounts *except* for the ease of merge which I want to test myself before giving my blessing to this patch. You wouldn't be the first one be to claim that "it merges" and create some issues unwittingly. If you could post the URL of an hg repo with your patch, I'll be happy to give it a spin building on all platforms. BTW, thanks for the super detailed comment: very interesting stuff.
Other reviews