New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed Question #478
Comments
(did 100,000 itterations and it's pretty clear)
|
Hi Joe, I'm not clear about the real-life problem here, so I'm not getting what we're trying to solve for. But in abstract terms, I think the biggest part of the performance difference is de-referencing time. Every time Python needs to navigate a dot-separator '.' (operator really) in a value expression, it incurs certain cost. For example, in These de-referencing operations take time. It can be a significant portion of the time Python spends doing anything, which is generally true of a dynamic language. This is the main time that Cython removes when used to optimize Python code. So if you're interested in speed, especially in tight loops, you need to maintain a reference to each "anchor" object you need. Like this would perform much better I'm sure
There could be other factors here as well, like what access operations incur re-parsing of the XML and which don't, but first would be to minimize de-referencing in a tight loop. |
Hey - so this might be a question about python or it might be about python-pptx.
I'm looking at the following code:
When I run the rests I get:
The difference is speeds makes me think that the presentation isn't being entirely loaded from disk when I open it - is there a way to speed up the access?
The text was updated successfully, but these errors were encountered: