Giter VIP home page Giter VIP logo

Comments (3)

sancar avatar sancar commented on May 28, 2024

@Svedrin
Shouldn't we increase the count to reduce cpu usage ? When count is one, the thread will wake up from the loop more frequently. Right now it wakes up every 100 millis. (1/10 of a second). For cpu, that should not be thathigh. When I run an idle client , it consumes at most 1% of a core in my machine. What is the cpu usage you are seeing ? If it is high, then can you describe the how you are using client ? May be we have another bug that cause this.

Integrating async-core loops does not really seem possible to me.
Is it done for similar libraries ? Do you know an example for that ? May be if we can find a smooth example that does this, we can offer the same thing.

from hazelcast-python-client.

Svedrin avatar Svedrin commented on May 28, 2024

@sancar

Right now it wakes up every 100 millis. (1/10 of a second).

actually it does not, because the timeout is set to 0.01, which is 1/100 of a second. asyncore calls this method ten times in a row, which means that asyncore itself does come back only after 1/10 of a second as you're saying. But it did ten syscalls in the meantime, whereas a single one would have the same effect here.

So setting count to 1 (or omitting it completely) and setting the timeout to 0.1 (which is what you're trying to achieve) would mean that you only use a single syscall instead of 10.

And well, the HZ client is already using asyncore, so it's integrated already :P

from hazelcast-python-client.

sancar avatar sancar commented on May 28, 2024

Pr looks good to me.

We'd appreciate being able to have the HZ client use our main loop ?
By integrating I meant this one. How can we expose an API so that, HZ client can be part of an external loop.

from hazelcast-python-client.

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.