Subject: | efficiency improvement -- cache the localtime() result to filename |
We make a system call to strftime on every log line, and only cache the resulting timestamp -> filename. We can do the caching step one step earlier -- if the localtime() result is the same, we don't need to call strftime.
This needs to be done in addition to the existing caching, as the localtime() could be different but the resulting timestamp still be the same, e.g. if the timestamp only contains the date and not the time.