-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BoundedQueue improvement #243
Comments
Hey, thanks for checking out the library and the queue. Below is a short history of quill queues .. I actually had that proposed implementation in earlier versions of the library and I also had some cross platform code for it. The code can be found here: https://github.com/odygrd/quill/blob/v1.5.0/quill/include/quill/detail/BoundedSPSCQueue.h The issues I had with shm were :
Because of the above issues, I then moved to an implementation where the tail and the head would just wrap around even for a non power of 2 size. (https://github.com/odygrd/quill/blob/v2.6.0/quill/include/quill/detail/spsc_queue/BoundedQueue.h). That queue worked quite well and showed good performance even for 99.9th percentiles. The drawbacks were that code was more complicated and also it required more branches. For version Having said that it might worth it at some point to benchmark the current |
Hey,Bro. I am curious about Why autor need allocating x2 memory inside BoundQueue? Can we only allocate x1 memory? |
@takohack if you about master version of I think it's not finished refactoring. @odygrd ^^ |
thanks for letting me know. I fixed it here and also made some improvements. It's mainly cosmetic changes and small things. https://github.com/odygrd/quill/pull/362/files Throughput is about the same as old version: old: Throughput is 2.21 million msgs/sec average, total time elapsed: 1809 ms for 4000000 log messages new: Throughput is 2.24 million msgs/sec average, total time elapsed: 1787 ms for 4000000 log messages |
Hi!
Instead of allocating x2 memory inside BoundedQueue you could
mmap(...)
the same memory region twice:The technique called
magic ring buffer
.BTW nice logger!
Thanks
The text was updated successfully, but these errors were encountered: