Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 5229474392047616: Issue 2582 - Optimize loop in ElemHide.getSelectorsForDomain() for V8 (Closed)

Created:
May 24, 2015, 5:12 p.m. by Sebastian Noack
Modified:
June 3, 2015, 3:46 p.m.
Visibility:
Public.

Description

Issue 2582 - Optimize loop in ElemHide.getSelectorsForDomain() for V8

Patch Set 1 #

Patch Set 2 : Use Object.getOwnPropertyNames() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M lib/elemHide.js View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 6
Sebastian Noack
May 24, 2015, 5:12 p.m. (2015-05-24 17:12:44 UTC) #1
Wladimir Palant
LGTM
May 24, 2015, 7:42 p.m. (2015-05-24 19:42:52 UTC) #2
Thomas Greiner
LGTM
May 26, 2015, 1:04 p.m. (2015-05-26 13:04:03 UTC) #3
Sebastian Noack
It turned out that Object.getOwnPropertyNames() is even faster. So here comes a new patch.
June 3, 2015, 11:09 a.m. (2015-06-03 11:09:08 UTC) #4
Thomas Greiner
LGTM I would've prefered `Object.keys()` because `Object.getOwnPropertyNames()` also includes non-enumerable properties. In this specific case, ...
June 3, 2015, 2:13 p.m. (2015-06-03 14:13:38 UTC) #5
Sebastian Noack
June 3, 2015, 2:18 p.m. (2015-06-03 14:18:41 UTC) #6
On 2015/06/03 14:13:38, Thomas Greiner wrote:
> I would've prefered `Object.keys()` because `Object.getOwnPropertyNames()`
also
> includes non-enumerable properties. In this specific case, however, it should
be
> fine since we don't have any of those.

Well, if we weren't optimizing here I would just keep te for..in loop.

Powered by Google App Engine
This is Rietveld