This is an old question, but I will still answer if there are other people who are looking for an answer.
So, we have a registration library that uses streams and tellp to determine file size. He called tellp for every magazine he made.
Thus, using the tellp 1 log line will take about 20 microseconds, depending on the machine. Without it, a magazine takes about 1 microsecond.
So yes, depending on your domain, this can be very expensive , or it may not matter at all.
ps the first optimization rule - do not optimize ..
source share