jperkin, As part of my recent #pkgin work I came across another optimisation for "pkg_admin rebuild-tree" using #DTrace that makes it a further 12x faster on my test system.
http://mail-index.netbsd.org/tech-pkg/2023/08/07/msg027952.html
This is in addition to the 13x speedup I committed a few years ago:
https://gist.github.com/jperkin/98550d5bd07f4179ebfeea825fc3ec20