r-lib / xml2

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

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

Closed MichaelChirico closed 10 months ago

MichaelChirico commented 10 months 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 10 months ago

Thanks!