Skip to content

Commit

Permalink
CSSPropertyAnimation::ensurePropertyMap() is large
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=121199

Reviewed by Darin Adler.

The bug was caused by repeated calls to Vector::append. Avoid it by storing pointers in a local array
and then adding them as we traverse them through to fill m_propertyToIdMap. Also reserve the full
initial capacity at once to avoid repeated calls to FastMalloc and FastFree.

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::instance):
(WebCore::CSSPropertyAnimationWrapperMap::wrapperForProperty):
(WebCore::CSSPropertyAnimationWrapperMap::wrapperForIndex):
(WebCore::CSSPropertyAnimationWrapperMap::indexFromPropertyID):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Renamed from ensurePropertyMap.
Also merged addShorthandProperties into it since they have to access local variables of the other.


Canonical link: https://commits.webkit.org/139300@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rniwa committed Sep 14, 2013
1 parent 35715c2 commit 8583afa
Show file tree
Hide file tree
Showing 2 changed files with 209 additions and 198 deletions.
19 changes: 19 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,22 @@
2013-09-12 Ryosuke Niwa <rniwa@webkit.org>

CSSPropertyAnimation::ensurePropertyMap() is large
https://bugs.webkit.org/show_bug.cgi?id=121199

Reviewed by Darin Adler.

The bug was caused by repeated calls to Vector::append. Avoid it by storing pointers in a local array
and then adding them as we traverse them through to fill m_propertyToIdMap. Also reserve the full
initial capacity at once to avoid repeated calls to FastMalloc and FastFree.

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::instance):
(WebCore::CSSPropertyAnimationWrapperMap::wrapperForProperty):
(WebCore::CSSPropertyAnimationWrapperMap::wrapperForIndex):
(WebCore::CSSPropertyAnimationWrapperMap::indexFromPropertyID):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Renamed from ensurePropertyMap.
Also merged addShorthandProperties into it since they have to access local variables of the other.

2013-09-13 Ryuan Choi <ryuan.choi@samsung.com>

Unreviewed build fix for EFL port.
Expand Down

0 comments on commit 8583afa

Please sign in to comment.