Bug 34188

Summary: SVG consumes way too much memory to store animated properties in the DOM
Product: WebKit Reporter: Nikolas Zimmermann <zimmermann>
Component: SVGAssignee: Nikolas Zimmermann <zimmermann>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, eric, krit, mjs, oliver, staikos, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch v1 - Part 1/2 (actual patch)
oliver: review+
Patch v1 - Part 2/2 (boring changes to all SVG*Element files) oliver: review+

Nikolas Zimmermann
Reported 2010-01-26 16:04:31 PST
The summary says it all. We're using a ridiciolous amount of memory for simple classes like SVGRectElement. Each SVGAnimatedProperty stores a pointer back to the SVG*Element which owns it - this is just needed for the bindings, and can be reworked in a different way, that does not consume memory :-) Believe it or not, the upcoming patch will cut WebCore library size to 70% and reduces the SVG memory consumption to <25% of the current amount.
Attachments
Patch v1 - Part 1/2 (actual patch) (131.76 KB, patch)
2010-01-26 17:05 PST, Nikolas Zimmermann
oliver: review+
Patch v1 - Part 2/2 (boring changes to all SVG*Element files) (185.95 KB, patch)
2010-01-26 17:06 PST, Nikolas Zimmermann
oliver: review+
Nikolas Zimmermann
Comment 1 2010-01-26 17:05:42 PST
Created attachment 47466 [details] Patch v1 - Part 1/2 (actual patch)
Nikolas Zimmermann
Comment 2 2010-01-26 17:06:34 PST
Created attachment 47467 [details] Patch v1 - Part 2/2 (boring changes to all SVG*Element files)
WebKit Review Bot
Comment 3 2010-01-26 17:08:28 PST
Attachment 47466 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 WebCore/svg/SVGElement.h:27: Alphabetical sorting problem. [build/include_order] [4] WebCore/svg/SVGElement.h:112: Alphabetical sorting problem. [build/include_order] [4] WebCore/svg/SVGPolyElement.cpp:96: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] WebCore/svg/SVGPolyElement.cpp:97: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] Skipping input 'WebCore/svg/SynchronizablePropertyController.h': Can't open for reading WebCore/svg/SVGAnimatedPropertySynchronizer.h:28: Code inside a namespace should not be indented. [whitespace/indent] [4] WebCore/svg/SVGAnimatedPropertyTraits.h:36: Code inside a namespace should not be indented. [whitespace/indent] [4] Skipping input 'WebCore/svg/SynchronizablePropertyController.cpp': Can't open for reading Skipping input 'WebCore/svg/SynchronizableTypeWrapper.h': Can't open for reading Total errors found: 6 If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Review Bot
Comment 4 2010-01-26 17:10:01 PST
Attachment 47467 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 WebCore/svg/SVGFEDiffuseLightingElement.h:50: Tab found; better to use spaces [whitespace/tab] [1] Total errors found: 1 If any of these errors are false positives, please file a bug against check-webkit-style.
Nikolas Zimmermann
Comment 5 2010-01-26 17:28:15 PST
(In reply to comment #3) > Attachment 47466 [details] did not pass style-queue: > > Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 > WebCore/svg/SVGElement.h:27: Alphabetical sorting problem. > [build/include_order] [4] > WebCore/svg/SVGElement.h:112: Alphabetical sorting problem. > [build/include_order] [4] > WebCore/svg/SVGPolyElement.cpp:96: Boolean expressions that span multiple > lines should have their operators on the left side of the line instead of the > right side. [whitespace/operators] [4] > WebCore/svg/SVGPolyElement.cpp:97: Boolean expressions that span multiple > lines should have their operators on the left side of the line instead of the > right side. [whitespace/operators] [4] > Skipping input 'WebCore/svg/SynchronizablePropertyController.h': Can't open for > reading > WebCore/svg/SVGAnimatedPropertySynchronizer.h:28: Code inside a namespace > should not be indented. [whitespace/indent] [4] > WebCore/svg/SVGAnimatedPropertyTraits.h:36: Code inside a namespace should not > be indented. [whitespace/indent] [4] > Skipping input 'WebCore/svg/SynchronizablePropertyController.cpp': Can't open > for reading > Skipping input 'WebCore/svg/SynchronizableTypeWrapper.h': Can't open for > reading > Total errors found: 6 Fixed all errors except the one in SVGElement.h:112, the include is required to be below the SVGElement declarations. Also fixed the tab in SVGFEDiffuseLightingElement.h
Oliver Hunt
Comment 6 2010-01-26 17:33:46 PST
Comment on attachment 47466 [details] Patch v1 - Part 1/2 (actual patch) r=me
Oliver Hunt
Comment 7 2010-01-26 17:38:58 PST
Comment on attachment 47467 [details] Patch v1 - Part 2/2 (boring changes to all SVG*Element files) In all of the updated constructors you have removed member initialisers for float types which is not cool
Oliver Hunt
Comment 8 2010-01-26 17:43:07 PST
Comment on attachment 47467 [details] Patch v1 - Part 2/2 (boring changes to all SVG*Element files) r=me
Nikolas Zimmermann
Comment 9 2010-01-26 17:53:48 PST
Thanks for the quick review. Landed in r53879.
Note You need to log in before you can comment on or make changes to this bug.