Bug 34188 - SVG consumes way too much memory to store animated properties in the DOM
Summary: SVG consumes way too much memory to store animated properties in the DOM
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nikolas Zimmermann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-26 16:04 PST by Nikolas Zimmermann
Modified: 2010-01-26 17:53 PST (History)
7 users (show)

See Also:


Attachments
Patch v1 - Part 1/2 (actual patch) (131.76 KB, patch)
2010-01-26 17:05 PST, Nikolas Zimmermann
oliver: review+
Details | Formatted Diff | Diff
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+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolas Zimmermann 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.
Comment 1 Nikolas Zimmermann 2010-01-26 17:05:42 PST
Created attachment 47466 [details]
Patch v1 - Part 1/2 (actual patch)
Comment 2 Nikolas Zimmermann 2010-01-26 17:06:34 PST
Created attachment 47467 [details]
Patch v1 - Part 2/2 (boring changes to all SVG*Element files)
Comment 3 WebKit Review Bot 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.
Comment 4 WebKit Review Bot 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.
Comment 5 Nikolas Zimmermann 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
Comment 6 Oliver Hunt 2010-01-26 17:33:46 PST
Comment on attachment 47466 [details]
Patch v1 - Part 1/2 (actual patch)

r=me
Comment 7 Oliver Hunt 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
Comment 8 Oliver Hunt 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
Comment 9 Nikolas Zimmermann 2010-01-26 17:53:48 PST
Thanks for the quick review. Landed in r53879.