RafaGago / mini-async-log

Non bloated asynchronous logger
Other
220 stars 20 forks source link

fixed spdlog bench #5

Closed gabime closed 9 years ago

gabime commented 9 years ago

This should fix it

RafaGago commented 9 years ago

It works better but it still is in the 5.0 - 11sec ballpark for the asynchronous version.

It's totally unfair to bench the thread joining time of an asynchronous logger compared to a synchronous one. The synchronous is bound to file IO, it will always be slower.

And this is what I don't get, how the sync implementation can be faster than the asyn one? I hope to find some time to check your source code to see if I identify the problem.

gabime commented 9 years ago

I think it is due to the fact that in the async mode, the client thread creates a new copy of the message and pass it to the queue but not sure..

Anyway, following your recommendation on reddit, I am replacing the blocking queue with Dmitry Vyukov's mpsc queue (http://www.1024cores.net/home/lock-free-algorithms/queues/intrusive-mpsc-node-based-queue)

I am not sure yet whether I am going to pool somehow the entries or whether the non blocking q would boost the performance so much that it wouldn't be needed...