Bug 125000 - [WebGL] Wrong condition order in the if statement
Summary: [WebGL] Wrong condition order in the if statement
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-28 23:14 PST by Przemyslaw Szymanski
Modified: 2014-01-13 03:29 PST (History)
6 users (show)

See Also:


Attachments
patch (3.37 KB, patch)
2013-11-29 01:51 PST, Przemyslaw Szymanski
bfulgham: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Przemyslaw Szymanski 2013-11-28 23:14:51 PST
We should make a more efficient if statements. In this case bool variable should be checked before string comparison. Only in one case (first check) a string variable will be compare. After that a bool variable is set and string should not be compare again.
Comment 1 Przemyslaw Szymanski 2013-11-29 01:51:24 PST
Created attachment 218042 [details]
patch
Comment 2 Brent Fulgham 2014-01-09 19:34:52 PST
Comment on attachment 218042 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=218042&action=review

You are right!  Let's clean the change log up slightly and get this landed.

> Source/WebCore/ChangeLog:3
> +        [WebGL] Wrong condition order in the if statement

[WebGL] Revise condition order for better performance

> Source/WebCore/ChangeLog:12
> +        this method.

Please Rephrase: We should revise the logic so that we only pay the cost of string comparison once.  The current logic causes the string comparison to happen every time we enter this function. Instead, by reordering the statements we can do a simple boolean test after the initial setup is complete.
Comment 3 Brent Fulgham 2014-01-10 10:02:16 PST
Comment on attachment 218042 [details]
patch

r=me. I'll fix the Changelog while landing.
Comment 4 Brent Fulgham 2014-01-10 10:08:11 PST
Committed r161645: <http://trac.webkit.org/changeset/161645>
Comment 5 Przemyslaw Szymanski 2014-01-13 03:29:46 PST
(In reply to comment #3)
> (From update of attachment 218042 [details])
> r=me. I'll fix the Changelog while landing.

Thank you very much for review of my patches. Unfortunately I didn't have time for update this commit message. Please be my guest to do this.

cq?