Code Monkey home page Code Monkey logo

Comments (7)

Bklyn avatar Bklyn commented on May 17, 2024

This sounds like a great feature. Holding up any thread to block on expensive I/O operations is a bad idea. There should be a way to set things up so a background thread handles all I/O.

from glog.

toddlipcon avatar toddlipcon commented on May 17, 2024

FWIW I ended up implementing this using existing public glog APIs, in case anyone's interested in borrowing the code for their projects (or for distribution as part of glog)

https://github.com/apache/kudu/blob/master/src/kudu/util/async_logger.h
https://github.com/apache/kudu/blob/master/src/kudu/util/async_logger.cc
https://github.com/apache/kudu/blob/master/src/kudu/util/logging.cc#L129 (EnableAsyncLogging)

from glog.

steve-o avatar steve-o commented on May 17, 2024

An additional enhancement with caveats is to replace the mutex with a lock-free queue, there is discussion by the author of g3log here:

https://kjellkod.wordpress.com/2015/06/30/the-worlds-fastest-logger-vs-g3log/

from glog.

tangfu avatar tangfu commented on May 17, 2024

@toddlipcon :hi,have you benchmark kudu's async_logger?with native glog?

from glog.

toddlipcon avatar toddlipcon commented on May 17, 2024

I didn't do throughput benchmarks, but the async logging solved a lot of blocking issues that we saw before where critical parts of our code would get "stuck" for several hundred milliseconds. Throughput is likely improved as well, but that's rarely a consideration for our app, so we didn't test it.

from glog.

Sasthan-SK avatar Sasthan-SK commented on May 17, 2024

Hi @sergiud @toddlipcon Since the ticket is closed, did we add Asynchronous/double-buffering support in glog ? It doesn't appear so, but can you please confirm.

from glog.

sergiud avatar sergiud commented on May 17, 2024

No support was added. The issue was closed due to inactivity. I'll reopen it.

from glog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.