xml2 icon indicating copy to clipboard operation
xml2 copied to clipboard

Use cpp11

Open mgirlich opened this issue 2 years ago • 3 comments

  • how to deal with memcpy()?
  • is the performance hit of the string handling relevant?
  • xml2_node.cpp can be tackled after #400 is merged.

mgirlich avatar Sep 04 '23 08:09 mgirlich

@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.

mgirlich avatar Nov 03 '23 10:11 mgirlich

Is it one or two functions in particular?

DavisVaughan avatar Nov 03 '23 12:11 DavisVaughan

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().

mgirlich avatar Nov 03 '23 12:11 mgirlich