January 30, 2021
https://issues.dlang.org/show_bug.cgi?id=21593

          Issue ID: 21593
           Summary: Only update file time if file to be written already
                    exists
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: bugzilla@digitalmars.com

This is a suggestion from Andrei.

Because file writes are so much slower than reads, and because of weak dependency management in build systems, the compiler will often generate the same files again and again. This changes file writes to first see if the file already exists and is identical. If so, it just updates the last written time on that file instead of writing a new one.

We discussed whether to "touch" the file or not, and decided if it wasn't touched, it would likely break many build systems.

--