turbokongen / hass-AMS

Custom component reading AMS through MBus adapter into HomeAssistant
44 stars 10 forks source link

Cpu usage #2

Closed Hellowlol closed 4 years ago

Hellowlol commented 4 years ago

The cpu usage is very high (I have a solution for this pr is coming)

I have added a async method and threaded method, I don't know what is best yet.

turbokongen commented 4 years ago

Yes, I did notice that. Initially I wanted to use the async serial, but I could not get it to work. Looking forward for your PR.

thomasja27 commented 4 years ago

The same thing happens to me, the load on the CPU increases to 30% when the plugin is active. usually I am at 1-2%

turbokongen commented 4 years ago

could you please try the cpu_ branch to see if that changes anything? Also can you supply what systems you are using? I'm using a rpi3+ and a intel i7700 server, and I do not have this issue.

Hellowlol commented 4 years ago

I noticed the same issue on my rpi3 and nuc i5

turbokongen commented 4 years ago

Does the cpu_ branch change the behaviour? I got 5-10% less Cpu usage on my server, and 1-4% less on the rpi3+

Hellowlol commented 4 years ago

Dunno, im using the stuff branch. Hass uses 2-6% on my nuc. Ill try the cpu_ later.

thomasja27 commented 4 years ago

With the cpu_ branch load is around 2-3% so it did make a huge difference :) The load was around 30% before.

My system: Lenovo M92P Intel Core I3-2120T @ 2.6 GHz 6 GB Ram 256GB SSD

Ubuntu, docker with hassio

turbokongen commented 4 years ago

Perfect! thanks for the feedback. I'll push the change to master branch.