Bug 98684
| Summary: | SVGResourcesCache::addResourcesFromRenderObject should not allocate SVGResources unconditionally | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
| Component: | SVG | Assignee: | Rob Buis <rbuis> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ahmad.saleem792, krit, pdr, thorton, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Eric Seidel (no email)
SVGResourcesCache::addResourcesFromRenderObject should not allocate SVGResources unconditionally
malloc() is very expensive.
addResourcesFromRenderObject unconditionally malloc's an SVGResources object, even though its not needed much of the time.
This causes fastMalloc to be one of the top samples in PerformanceTests/SVG/SvgNestedUse.html
Fixing this is a slightly involved change, as we'll either need to make SVGResources::buildCachedResources static, and return a PassOwnPtr<SVGResources> or we need a separate method to check if we need an SVGResources in the first place.
Relatedly, I think buildCachedResources is too long, and could be cleaned up to be more readable. :)
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
Fixed in following:
https://src.chromium.org/viewvc/blink?view=revision&revision=163121
Rob Buis
Pull request: https://github.com/WebKit/WebKit/pull/19094
Ahmad Saleem
Performance Test Case mentioned in Comment 0: https://jsfiddle.net/gy16bv0t/show
EWS
Committed 269397@main (236dd9dd2c2c): <https://commits.webkit.org/269397@main>
Reviewed commits have been landed. Closing PR #19094 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/117056723>