AdvDupe2 uses a temporary file to store and process the dupe contents as a stream. This works, but adds unnecessary complexity by having to create a file on the actual file system, and can cause problems if there's an issue accessing that file.
Implementing the buffer using Lua might also improve speed.