Optimize xml_path() and xml_find_all() for large node sets
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- r
- Lĩnh vực
- performance
Hướng nghiên cứu
Start with the xml_path() and xml_find_all.xml_node() entry points, then review the regression tests described in the issue. Confirm that batch xml_path() output matches per-node output and that single-context XPath node sets remain unique. Benchmark large node sets and attribute result sets to verify the optimization preserves semantics and improves materialization time.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
xml_path() and xml_find_all() can spend substantial time in wrapper-side work when operating on large node sets.
I have a local branch with two general optimizations, both intended to preserve existing semantics:
- Speed up
xml_path()for largexml_nodesets by caching reusable ancestor paths within a single call. - Speed up
xml_find_all.xml_node()materialization by avoiding an unnecessary duplicate pass for single-context XPath node sets and reducing per-node R object construction overhead.
Is this a direction you would be open to reviewing as a PR?
Isolated benchmark results from my local machine:
-
xml_path()on a synthetic node set with 124,001 nodes:- before: ~0.77s
- after: ~0.07s
-
xml_path()on a large real-world XML bundle with 415,022 selected nodes:- before: ~2.43s
- after: ~0.28s
-
xml_find_all()/ XPath result materialization on large attribute result sets:- synthetic 300k attributes: roughly 1.5-2x faster in the materialization-heavy path
- real-world XML bundle,
//@*, 155,009 attributes: roughly 1.6-2x faster in isolated runs
The changes are not specific to any particular XML schema or downstream package. They target repeated ancestor path construction and large XPath result materialization.
I added regression tests comparing batch xml_path() output to per-node xml_path() output, and checking that single-context xml_find_all() XPath node sets remain unique.
- Ngôn ngữ chính
- R
- Star
- 227
- Fork
- 86
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của r-lib/xml2
-
Export libxml2_version()Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Bioconductor/BiocParallel#289 ·
-
automation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
waldronlab/BugSigDBcuration#2224 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
merliseclyde/BAS#118 ·