r-lib / xml2

Bindings to libxml2
https://xml2.r-lib.org/
Other
220 stars 82 forks source link

Use cpp11 #405

Open mgirlich opened 1 year ago

mgirlich commented 1 year ago
mgirlich commented 1 year ago

@DavisVaughan I now also migrated xml2_node.cpp to cpp11. But the performance hit from string handling really bites us now. It is nearly as slow as before replacing the S3 dispatch.

DavisVaughan commented 1 year ago

Is it one or two functions in particular?

mgirlich commented 1 year ago

I haven't looked into this in more detail but only checked xml_name() (see the benchmark in https://github.com/r-lib/xml2/pull/400). The easiest would probably be to check and carefully revert some of the changes and then wrap things with cpp11::unwind_protect().