_computedStringForNode should be rewritten in C++ for performance.
Created attachment 226781 [details] Cleanup
This reduces the runtime from 25-26s to 21-22s (another 20% improvement).
Comment on attachment 226781 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=226781&action=review > Source/WebCore/platform/mac/HTMLConverter.mm:631 > + if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyName)) { > + String result; > + if (stringFromCSSValue(*value, result)) > + return result; > + } > + > + if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyName)) { > + String result; > + if (value->isInheritedValue()) > + inherit = true; > + else if (stringFromCSSValue(*value, result)) > + return result; > + } Why are we calling computedStylePropertyForElement(element, propertyName) twice here? > Source/WebCore/platform/mac/HTMLConverter.mm:720 > + if (Node* parent = node.parentNode()) This is really a ContainerNode*. > Source/WebCore/platform/mac/HTMLConverter.mm:733 > + if (!result.length()) I'd use isEmpty() here.
Comment on attachment 226781 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=226781&action=review >>> Source/WebCore/platform/mac/HTMLConverter.mm:631 >>> + } >> >> Why are we calling computedStylePropertyForElement(element, propertyName) twice here? > > Why are we calling computedStylePropertyForElement(element, propertyName) twice here? Oops, the second is supposed to be calling computedStylePropertyForElement.
Created attachment 226959 [details] Fixed the bug
Committed r165761: <http://trac.webkit.org/changeset/165761>