05.08.2011, 22:08
i suggest you to keep the file open while the server is running. if you restart/exit/crash the server, the file will remain intact.
to estimate the CPU usage, i suggest you to use the Profiler Plugin by Incognito
https://sampforum.blast.hk/showthread.php?tid=271129
if your players arent spamming >50 lines per second, then dont hesitate to log each line. just script it, and see how many microseconds each log needs...
a quick estimation of file read processes. takes 4 microseconds each. assuming that youre not processing the strings anymore before logging, i guess 1 chatline will take like 80-200 µs to process (fopen, format string, fwrite, fclose).
if you keep it open, then you save "only" 2 processes each. wont matter if you ask me hehe
to estimate the CPU usage, i suggest you to use the Profiler Plugin by Incognito
https://sampforum.blast.hk/showthread.php?tid=271129
if your players arent spamming >50 lines per second, then dont hesitate to log each line. just script it, and see how many microseconds each log needs...
Код:
Function Calls Time per call, µs Overall time, µs Overall time, % fread 39285 4 159927 0.18 format 502542 3 1337524 1.54 fclose 320 12 3883 0.00
if you keep it open, then you save "only" 2 processes each. wont matter if you ask me hehe