I'm trying to update some tags on videos on my fileserver - each write operation is taking over two minutes. I'm running v3.18.
Does MP3Tag download the file and write it back? Even so, it seems to be taking a long time.
Music files, on the same server, are updated instantaneously - although of course we're talking a few Mb versus a couple of Gb file size.
Remember that sometimes the tags are written at the end of the file. There are ways to make them “streaming”-friendly by moving it to the beginning. It helps in updating as well as long as you don’t extend beyond the allocated space.
It's usually the files that need to be rewritten via a temporary file that cause slow writing operations.
This happens when reserved space for metadata changes is not sufficiently large enough to hold the addition (e.g., when adding cover art). In this case, the whole file content needs to be transferred to a temporary file which is renamed back.
I guess new temporary file is written on network (location of original file) and renamed from .tmp to .whateverextensionis and the end of process.
But my question was the following:
Wenn you are rebuild tag
do you rebuild tag directly on filestream (causing many single small file i/o operations)
do you build tag to an memorystream and do a filestream.CopyFrom(memorystream) or BlockWrite() when you finished rebuilding tag (takes more memory but one single big write operation is much faster on network)
do you copy file content blockwise from source to tmp file? how big is block size? should be bigger than 1mb depending on filesize > 10mb
That effect is visible on local drives too, but much much less.
On Network (1GB cable based) you can measure the difference cause every single file operation causing a few network requests.
Yes, I'm using whatever GetTempFileName() returns for the given file name. If it's on a network share, Mp3tag has to read the entire file and write it back to the network destination. This usually has a far bigger impact than any specific means on how changes are written on a I/O level.
I'm not saying that they don't have any effect, but it's most likely not was the OP is observing.
Edit: I don't have a generic answer on your other question. I'm using all three different approaches depending on the file format, file size, and the point in time when I've implemented the respective format.