diff is currently implemented in a very naive way: we build materialized paths for both branches we are comparing, and then doing an full outer join on those two. Might be able to do something smarter (diff directories on-the-go instead of materializing?).