2 ms·
Does Zap add the datetime in every http response as header because Go does it and those are syscalls so it reduces performance.
by Thaxll 3y ago
Does Zap add the datetime in every http response as header because Go does it and those are syscalls so it reduces performance.
- fluffyspork 3y agoNice to see someone else thinks about this. In my personal project webserver I don't. I didn't measure, but just trying not to do unnecessary work.
- memefrog 3y agoThat shouldn't reduce performance too much, right? Getting the current time is such a frequently-executed system call that, as far as I understand, its implementation is in a vDSO in Linux that is loaded into every process. This means you shouldn't need the full cost of a system call when you get the current time.