Opened 15 years ago
Last modified 8 years ago
#392 new enhancement
Small patch to path.py which will improve on overall memory usage for more complex templates
Reported by: | Carsten Klein <carsten.klein@…> | Owned by: | cmlenz |
---|---|---|---|
Priority: | minor | Milestone: | 0.9 |
Component: | XPath support | Version: | 0.6 |
Keywords: | Cc: |
Description
See the attached file.
What it basically does is that all strategies are now considered more or less stateless. By that, they will not be instantiated on a per path basis, but rather references to supporting strategies will be stored in a (path, strategy) tuple that holds a reference to the "singleton" strategy instance.
In addition, the single step strategy was modified to locally cache identical paths and fragments thereof.
The main benefit of the patch is that instances of the strategies are being shared by multiple paths. This might reduce overall stream processing time in the long run. In addition, overall memory usage will be reduced.
From the tests I have run using a local trac installation and some debug output (time.clock()) around chrome.render, the differences in rendering time between the original implementation and the "optimized" patch are negligible, if not identical.
Attachments (1)
Change History (2)
Changed 15 years ago by Carsten Klein <carsten.klein@…>
comment:1 Changed 8 years ago by hodgestar
- Milestone changed from 0.7 to 0.9
Moved to milestone 0.9.