Skip to content

XPath vs find #241

Open
Open
@serrufSe

Description

@serrufSe

Hi, Scanny,

Profiling the script that used python-docx revealed that the bottleneck is "first_child_found" method from "docx.oxml.xmlchemy._OxmlElementBase" class. The problem is in using a method that extends ElementTree API method "find".
Based on this article — http://www.ibm.com/developerworks/library/x-hiperfparse/, i replaced "find" method to xpath-request and gained performance boost. What do you think about this? Should we replace all "find" and "findall" usages with xpath-requests?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions