For whatever reason we had a completely bogus strcmp in HTMLTokenizer which accounted for .2% of all time spent in the PLT (on my MBP): @@ -901,7 +900,7 @@ ptr[--len] = '\0'; // Now that we've shaved off any invalid / that might have followed the name), make the tag. - if (ptr[0] != '!' && strcmp(ptr, "!doctype") != 0) { + if (ptr[0] != '!') { // make sure it's not a !DOCTYPE currToken.tagName = AtomicString(ptr); currToken.beginTag = beginTag; }
Created attachment 7255 [details] Remove bogus strcmp to save on plt
Can't "!" also be present for comment elements?
Comment on attachment 7255 [details] Remove bogus strcmp to save on plt I think the right change is to change the && to a ||. We're supposed to allow tags like <!custom> I believe.
I had considered the ||, but hyatt and I couldn't think of any valid use case for !tagname. I'll change it to or and add a test case for parsing a <!foo></!foo> tag.
(In reply to comment #4) > I had considered the ||, but hyatt and I couldn't think of any valid use case > for !tagname. I'll change it to or and add a test case for parsing a > <!foo></!foo> tag. If we're going to disallow anything starting with "!" (and Dave is definitely an authority on making that call), we should both have tests and also change the comment. I think we can do better than a comment that specifically mentions DOCTYPE and code that checks only for "!".