We are performing way too many allocations in the StartWritingLogs function in the server log writer file. We need to optimize that so that high bursts of incoming log traffic could be ingested. Things we can try:
- We can move the code in the
BarkLogDao.InsertBatch function to the StartWritingLogs function - that should avoid the memory copy required for making the function call and the memory allocations happening inside the InsertBatch function.
- We can allocate a variable for large, medium and small batches. These should be arrays instead of slices so that the loop does not have to reallocate the slice on append.
We are performing way too many allocations in the
StartWritingLogsfunction in the server log writer file. We need to optimize that so that high bursts of incoming log traffic could be ingested. Things we can try:BarkLogDao.InsertBatchfunction to theStartWritingLogsfunction - that should avoid the memory copy required for making the function call and the memory allocations happening inside theInsertBatchfunction.