Optimize xml_path() and xml_find_all() for large node sets
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- r
- Área
- performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- R
- Estrellas
- 227
- Forks
- 86
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de r-lib/xml2
-
Export libxml2_version()Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 67/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Todos los issues de r-lib/xml2
Issues similares
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Bioconductor/BiocParallel#289 ·
-
automation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
waldronlab/BugSigDBcuration#2224 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
merliseclyde/BAS#118 ·