r-lib / xml2

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

double-truncate to avoid inefficient encodeString() usage #413

Closed MichaelChirico closed 1 year ago

MichaelChirico commented 1 year ago

Closes #366.

There are some existing tests that were broken in as I was working on this, so I think those plus the new test are enough.


Re: the example raised in the issue, I see timing drop from ~1s to ~0.25s on my machine. Still noticeably slow, but a definite improvement. A quick profile shows we're going to need to drop to C++ to do any better.

hadley commented 1 year ago

Thanks!