WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
7938
Shave .2% on PLT by removing bogus strcmp.
https://bugs.webkit.org/show_bug.cgi?id=7938
Summary
Shave .2% on PLT by removing bogus strcmp.
Eric Seidel (no email)
Reported
2006-03-23 11:45:37 PST
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; }
Attachments
Remove bogus strcmp to save on plt
(1.65 KB, patch)
2006-03-23 11:46 PST
,
Eric Seidel (no email)
darin
: review-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Eric Seidel (no email)
Comment 1
2006-03-23 11:46:16 PST
Created
attachment 7255
[details]
Remove bogus strcmp to save on plt
Geoffrey Garen
Comment 2
2006-03-23 12:44:55 PST
Can't "!" also be present for comment elements?
Darin Adler
Comment 3
2006-03-23 13:18:07 PST
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.
Eric Seidel (no email)
Comment 4
2006-03-23 13:28:50 PST
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.
Darin Adler
Comment 5
2006-03-23 13:56:53 PST
(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 "!".
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug