I don’t know if this is just be a weird artefact of running in Docket on an Arm Mac, but I was surprised to find it substantially faster to run my tree walking code on Node and call out to Postgres than run it all in Postgres with plv8. Perhaps it was using a fresh interpreter per transaction?