Apparently function calls are cheap in elisp. I rewrote a recursive function as iterative and was pleasantly surprised that perf matched.