sivasekar / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

[Performance improvements] Frame_Decorator iterator memory leak #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Frame_Decorator->reset() gets called many times. Got thousands of calls
on a large PDF file. (Monitored with xdebug). That function calls
get_children() function.

The function get_children() as well as get_subtree() uses return new
MyObject(); structure. So every time that function is called a new object
is created. So if the reset() function is called which opens get_children()
and if I use that large PDF, the get_children create thousands of un
nessecary objects.

Please give the Frame_Decorator, protected values and set those objects to
those variables in the constructor, so they are created only once.

Original issue reported on code.google.com by michiele...@gmail.com on 5 Oct 2009 at 12:41

GoogleCodeExporter commented 9 years ago
These resets don't appear to be necessary. Here's a patch that removes them. 
This shaves off about 20% overhead.

A quick scan of all the examples seems to indicate that this breaks nothing.

Original comment by peter....@solide-ict.nl on 15 Jun 2011 at 3:30

Attachments:

GoogleCodeExporter commented 9 years ago
Turns out it does break something.. will work on a better patch

Original comment by peter....@solide-ict.nl on 16 Jun 2011 at 8:22

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Keep in mind though that sometimes even the constructor does use the reset 
function as well as the reset() is public. So you can even use it in external 
code.

Original comment by michiele...@gmail.com on 16 Jun 2011 at 8:45

GoogleCodeExporter commented 9 years ago
Keep in mind though that sometimes even the constructor does use the reset 
function as well as the reset() is public. So you can even use it in external 
code.

Original comment by michiele...@gmail.com on 16 Jun 2011 at 8:45

GoogleCodeExporter commented 9 years ago
I'm giving up for now, it's a bit too tangled to figure out how to improve this

Original comment by peter....@solide-ict.nl on 16 Jun 2011 at 9:20

GoogleCodeExporter commented 9 years ago
Note that the original request was implemented; get_children caches the 
framelist and returns the previously made object when it's still there.

Original comment by peter....@solide-ict.nl on 16 Jun 2011 at 9:21

GoogleCodeExporter commented 9 years ago
@peter thanks for the update, we'll take a closer look at that functionality to 
see if any additional enhancements can be made.

Original comment by eclecticgeek on 16 Jun 2011 at 3:05

GoogleCodeExporter commented 9 years ago
A cache for the get_children methods was added in r374. The get_subtree subtree 
method is never used.

Original comment by fabien.menager on 23 Oct 2011 at 2:56

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:15