Bug 46745 - Fix perf/class-list-remove test
Summary: Fix perf/class-list-remove test
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Erik Arvidsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-28 12:09 PDT by Erik Arvidsson
Modified: 2010-09-28 15:52 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.94 KB, patch)
2010-09-28 12:09 PDT, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch (2.21 KB, patch)
2010-09-28 14:56 PDT, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch for landing (2.27 KB, patch)
2010-09-28 15:02 PDT, Erik Arvidsson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Arvidsson 2010-09-28 12:09:09 PDT
Fix perf/class-list-remove test
Comment 1 Erik Arvidsson 2010-09-28 12:09:59 PDT
Created attachment 69083 [details]
Patch
Comment 2 Darin Adler 2010-09-28 12:16:51 PDT
Comment on attachment 69083 [details]
Patch

For next time, it would be good to explain what was wrong in the change log and why your fix should work. This is especially helpful if the fix is ineffective and someone else is trying to figure out what you meant to do.
Comment 3 Ojan Vafai 2010-09-28 13:54:27 PDT
Comment on attachment 69083 [details]
Patch

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

> LayoutTests/perf/class-list-remove.html:22
>  function test1(magnitude)
>  {
> +    var s = 'b';
> +    element.className = Array(magnitude).join('a ') + s;
>      element.classList.remove(s);

I worry that this is testing Array.join's perf more than classList.remove. Shouldn't the Array.join be in the setup function? Same with test2.
Comment 4 Ojan Vafai 2010-09-28 14:55:35 PDT
Comment on attachment 69083 [details]
Patch

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

>> LayoutTests/perf/class-list-remove.html:22
>>      element.classList.remove(s);
> 
> I worry that this is testing Array.join's perf more than classList.remove. Shouldn't the Array.join be in the setup function? Same with test2.

What I mean is that you should do something like the following. In the setup function:
classToUse = Array(magnitude).join('a ') + 'b';

Then in the test function:
element.className = classToUse;
Comment 5 Erik Arvidsson 2010-09-28 14:56:03 PDT
Created attachment 69112 [details]
Patch
Comment 6 Ojan Vafai 2010-09-28 15:00:00 PDT
Comment on attachment 69112 [details]
Patch

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

> LayoutTests/perf/class-list-remove.html:4
> +var element, className, s;

Nit: would be nice to have a more descriptive name than s. classToRemove perhaps?
Comment 7 Erik Arvidsson 2010-09-28 15:00:48 PDT
Comment on attachment 69112 [details]
Patch

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

>> LayoutTests/perf/class-list-remove.html:4
>> +var element, className, s;
> 
> Nit: would be nice to have a more descriptive name than s. classToRemove perhaps?

Done.
Comment 8 Erik Arvidsson 2010-09-28 15:02:45 PDT
Created attachment 69115 [details]
Patch for landing
Comment 9 WebKit Commit Bot 2010-09-28 15:52:35 PDT
Comment on attachment 69115 [details]
Patch for landing

Clearing flags on attachment: 69115

Committed r68596: <http://trac.webkit.org/changeset/68596>
Comment 10 WebKit Commit Bot 2010-09-28 15:52:40 PDT
All reviewed patches have been landed.  Closing bug.