← Back to home
Comparison · DevOps

withr vs xml2

A side-by-side editorial comparison of withr and xml2 — release velocity, themes, recent moves, and the top alternatives to consider.

Shared themes:performancemaintenance

withr vs xml2: at a glance

Featurewithrxml2
SectorDevOpsDevOps
Velocity score0.00.0
Sparks · 30d00
Top themesstate-management, testing, performance, base-rparsing, performance, licensing, dependencies
Last editorial update1h ago1h ago
WebsiteVisit →Visit →

What is withr?

withr rebuilt defer() on base R's own on.exit(), and got much faster for it

withr provides the with_ and local_ functions that temporarily change global state and restore it on exit - the cleanup primitive under most of the tidyverse test suites. Version 3.0.0 reimplemented defer() as a thin wrapper over base::on.exit(), which the maintainers made possible by contributing the required arguments to R 3.5 itself. Everything since has been small correctness work.

Read the full withr trajectory →

What is xml2?

xml2 relicensed to MIT, then moved its hot accessors from S3 into C

xml2 is the libxml2 binding under most R HTML and XML work, including rvest. Its release cadence is set by libxml2 versions and R CMD check, but two of the last six matter on their own: the 1.3.3 MIT relicense and the 1.3.6 dispatch rewrite that pushed the common accessors into C and dropped three dependencies.

Read the full xml2 trajectory →

withr vs xml2: editorial side-by-side

W
withr
DEVOPS
0.0

withr rebuilt defer() on base R's own on.exit(), and got much faster for it

◆ Current state

withr provides the with_ and local_ functions that temporarily change global state and restore it on exit - the cleanup primitive under most of the tidyverse test suites. Version 3.0.0 reimplemented defer() as a thin wrapper over base::on.exit(), which the maintainers made possible by contributing the required arguments to R 3.5 itself. Everything since has been small correctness work.

◆ Where it's heading

The arc here is a package pushing its own machinery down into base R and then living off the result. Once defer() became on.exit(), the remaining work is about where cleanup is allowed to happen - knitr documents, source() calls, the global environment, session end - and about restoring state correctly when an expression exits early. Releases are now infrequent and CRAN-driven.

◆ Prediction

Expect continued low-volume releases fixing edge cases in where deferred handlers run; with the core delegated to base R, there is little left that would prompt a larger change.

X
xml2
DEVOPS
0.0

xml2 relicensed to MIT, then moved its hot accessors from S3 into C

◆ Current state

xml2 is the libxml2 binding under most R HTML and XML work, including rvest. Its release cadence is set by libxml2 versions and R CMD check, but two of the last six matter on their own: the 1.3.3 MIT relicense and the 1.3.6 dispatch rewrite that pushed the common accessors into C and dropped three dependencies.

◆ Where it's heading

This is infrastructure maintenance in the strict sense - most releases exist because the toolchain moved, not because the package did. Where the maintainers do choose the work, it goes to performance and dependency reduction rather than new API, and the surface has been essentially stable since 1.3.0.

◆ Prediction

Expect the next releases to track libxml2 compatibility and R-devel format-string warnings; new API is unlikely beyond occasional XPath accessors in the style of xml_find_int().

Alternatives to withr and xml2

Other DevOps products tracked by Sparkpulse, ranked by recent ship velocity. Each card links to a full editorial trajectory and lets you pivot into a head-to-head comparison with either withr or xml2.

See all withr alternatives → · See all xml2 alternatives →

Recent activity from withr and xml2

Latest ship moves from both products, interleaved chronologically. ⚡ = editorial spark.

  1. 1mo agowithrlocal_seed() actually preserves the seed now
  2. 1y agowithrlocal_language() no longer warns when set to C
  3. 2y agowithrdefer() becomes a thin wrapper over base::on.exit()
  4. 2y agoxml2Accessors dispatch in C; glue, withr and lifecycle dropped
  5. 3y agoxml2Small xml_find_all() speedup and check fixes
  6. 3y agoxml2R CMD check fixes and a Windows libxml2 bump
  7. 4y agowithrCleanup works inside Rmd and source(); with_() gains a getter
  8. 4y agoxml2Relicensed to MIT, with Hadley Wickham back as maintainer
  9. 4y agowithrNew maintainer; handlers run at session end
  10. 5y agowithrlocal_options() can set NULL; with_seed() controls RNG kind
  11. 6y agoxml2Rejects multi-element strings; fixes a raw-input regression
  12. 6y agoxml2Restores reading HTML with non-ASCII encodings

Frequently asked questions

What is the difference between withr and xml2?

Both compete on the same themes — performance, maintenance — within DevOps. withr and xml2 are shipping at a similar cadence (velocity 0.0 vs 0.0, both within Sparkpulse's "active" band). See the at-a-glance table above for a side-by-side breakdown of velocity, recent sparks, and editorial themes.

Is withr better than xml2?

Sparkpulse doesn't pick a winner — we score release velocity, not feature parity. withr and xml2 are shipping at a similar cadence (velocity 0.0 vs 0.0, both within Sparkpulse's "active" band). For your specific use case, the alternatives sections above list other DevOps products to evaluate alongside.

What are the best alternatives to withr?

Top withr alternatives in DevOps are ranked by recent ship velocity. Browse the "withr alternatives" section above for the current picks, or visit /alternatives/withr for the full list with editorial commentary on each.

What are the best alternatives to xml2?

Top xml2 alternatives in DevOps are ranked by recent ship velocity. Browse the "xml2 alternatives" section above for the current picks, or visit /alternatives/xml2 for the full list with editorial commentary on each.