Use a Vector instead of HashSet to computed the orderValues in RenderFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=118620 Reviewed by Antti Koivisto. PerformanceTests: From Blink r152960 by <email@example.com> New performance test for layouts in flexboxes. * Layout/flexbox-lots-of-data.html: Added. Source/WebCore: Turns out that order is extremelly uncommon so using a Vector is much less expensive. This also special-cases the much common case of only having order of value 0 by using Vectors with just one preallocated member. Also added the performance test that shows a ~1% win when using a vector instead of the HashSet. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::OrderIterator::setOrderValues): (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): * rendering/RenderFlexibleBox.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Showing with 120 additions and 21 deletions
This diff is collapsed.