When compressing multiple files, is it more efficient to (1) first compress each individual file separately and then concatenate/merge the results, or (2) first concatenate/merge the files into a single archive and then compress that archive? Which one will be faster, in terms of running time?
From what I understand back in the days (.tar.gz, .tar.Z) when a number of files were archived the files were usually "merged together", and then the resulting file was compressed. But now on newer systems with newer software and algorithms like WinRAR or win ZIP, the files are individually compressed and then the resulting compressed files were merged together to form an archive. Is one of those approaches faster than the other?
It seems like (2) might be faster. Let's take for example huffman compression. If we compress different files separately than we need to remember a dictionary or some sort of table where we know how many times or with what percentage a certain word appears in the file. This table takes additional space for every file stored. If we compress a huge file than we store less tables. Is this right?
efficient (in terms of space and processing time)
might have meant something else: in the context of complexity analysis, space looks RAM required for processing, with data compression, it may have referred to effectivity: output size: please comment.) $\endgroup$