Lightroom does not rewrite the entire DNG file when saving metadata to the file, either via Cmd/Ctrl-S or when you have the "Automatically write changes into XMP" catalog setting enabled.
I verified this by monitoring Lightroom CC 2016.6.1 on OS X 10.11.6 under dtruss
, then wrote a Perl script to analyze the collected data. The comments in that script explain the method, but if you only want to see a typical set of results, here you go:
Data I/O for file _1020153.RW2:
256K read
Data I/O for file _1020153.xmp:
6.87K read
3.59K written
Data I/O for file _1020176.dng:
3.38M read
6.52K written
The two raw files named above were captured on the same day by the same camera, and the I/O comes from applying the same keyword to each file. The only difference is that one is the camera's native raw file (Panasonic RW2) and the other was converted by Lightroom to DNG before the test. The RW2 file is 18.7 MiB and the DNG file is 13.4 MiB. (The size difference is because DNG uses better lossless compression than is typical for native camera raw formats.)
As you can see, although neither update wrote out nearly enough data to rewrite the entire file, the DNG update involved about 13× as much reading and nearly 2× as much writing.
Also of interest is that Lightroom does more than just write to the XMP file in the native camera raw case. It also reads a substantial amount of data from the raw file, probably to assure itself that the raw file hasn't changed out from under it before it goes writing to the companion XMP file.
I would not take this single test result as representative if I were you, however. Try it on your own files. I wouldn't be surprised if you got different results.
Keep in mind that the full cost of these I/Os is only paid the first time you work on a given set of files in a given Lightroom session. If you apply a bunch of keywords in succession, the data reads in particular will be nearly instant, since the file contents will still be in your OS's buffer cache.
dtruss
is not available for Windows, but there are equivalent alternatives. Adapting the Perl analysis script to work with the output of such tools should be straightforward.