Improved PrintHierarchy efficiency.