We should probably merge:
Cache several vectors to avoid malloc/free churn
resolveContentBasedTrackSizingFunctionsForItems are both
called in a loop during layout and resulted in a lot of
mallocs / frees calls. This change just keeps their Vectors
around until the end of Layout, keeping the memory around.
This is a classic runtime vs memory trade-off as we will hold
onto the biggest allocation until the end of layout, which
should be fine as we *have* to allocate that amount.
This code refactors the often passed-in arguments & the cached
Vectors into a new data structure GridSizingData. This makes
the code cleaner while making it difficult to forget free'ing
the memory at the end of layout.
This is a 40% improvement on auto-grid-lots-of-data.html.
Review URL: https://chromiumcodereview.appspot.com/24331003
I have a patch ready for this, but I won't upload it as it depends in another two patches already pending on review.
Created attachment 217664 [details]
Comment on attachment 217664 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=217664&action=review
> + Layouting the grid items means a lot of calls to
Committed r159741: <http://trac.webkit.org/changeset/159741>