PathOfBuildingCommunity / PathOfBuilding

Offline build planner for Path of Exile.
https://pathofbuilding.community
Other
4.03k stars 2.09k forks source link

PoB uses too much CPU while in background #604

Closed ZzZombo closed 4 years ago

ZzZombo commented 4 years ago

While it's running in background, it still uses way too much CPU, contending heavily with Path of Exile, ironically, and sometimes even beating it even so slightly. I've realized that part of the issue is that PoB still tracks mouse if not minimized, causing all the tooltips to calculate and pop up even in background. Minimizing the program to the taskbar lowers CPU utilization, but still leaves it subpar. I'd rather see it not to use more than 1-5% of CPU while not being in focus.

coldino commented 4 years ago

I have seen it flickering, redrawing controls repeatedly out of the corner of my eye. This happens even when not focused but simply shown on a second monitor.

fromcj commented 4 years ago

My computer often locks up completely if I leave PoB running while playing PoE, I would bet its related to this.

sthalik commented 4 years ago

See: https://github.com/sthalik/PathOfBuilding-SimpleGraphic

ppoelzl commented 4 years ago

@sthalik I'm not sure what this it. Your repo doesn't even have a README.

sthalik commented 4 years ago

It's a fork of the library PoB uses for its window handling and main loop. I fixed it years ago and the original author ignored it, despite several people testing it.

Fish013 commented 4 years ago

@sthalik are there any build instructions or pipeline scripts in place to replicate the build process? Especially considering i had problems gathering and including all the used dependencies last time i tried. We can not ship prebuild binaries via the update, that would imply huge security and trust risks to our users. Aside from that looks pretty nice, and i would like to see some progress here. Edit: Also, like ppoelzl said, some docs about the changes you made, and maybe about the runtime in general would be nice.

sthalik commented 4 years ago

@sthalik are there any build instructions or pipeline scripts in place to replicate the build process?

CMake.

Note, the changes are against the last released source code of SimpleGraphic. I can't rebase them against the newer versions since they remain closed. However, now that the software is forked, it's easy to revert any changes that require further additions to the SimpleGraphic library.

Also, like ppoelzl said, some docs about the changes you made, and maybe about the runtime in general would be nice.

I made sure that the GUI gets updated only if:

  1. There's a background script, like a download, running
  2. There's a new window action, like a click, or a mouseover
Nostrademous commented 4 years ago

Funny, I was just looking at this and stumbled onto here. Was debating if it is worth passing-though c-call for Qt's getActiveWindow ([static]QWidget * QApplication::activeWindow()) so PoB would know when it's an active window and only update GUI then. Your solution is probably better as it's below Lua.

Fish013 commented 4 years ago

@sthalik where do i get the required libs from, which version do i need to use and how do i build them if i need to? I.e. i am currently missing the tiff.lib when trying to build from the makefile

sthalik commented 4 years ago

libtiff. You should be able to do that on your own.

ppoelzl commented 4 years ago

@sthalik Your lack of documentation doesn't make your modification attractive to merge anytime soon.

Fish013 commented 4 years ago

How so without any form of documentation or build pipeline setup? i'm not too familiar with c/c++ and the ecosystem behind it, but i'm trying to get this to work on my end so i can do some testing and talk to the maintainers of the fork if they are interested in integrating your solution. I'm pretty sure they are not going to take the binary and drop it into the project without being able to build it by themselves either.

sthalik commented 4 years ago

@sthalik Your lack of documentation doesn't make your modification attractive to merge anytime soon.

That's not my lack of documentation. That's a slightly cleaned-up blob that was originally included with PoB. I can't vouch for its quality. I haven't given it any review.

Fish013 commented 4 years ago

@sthalik So you are not willing to share the steps you figured out to build this in a bit more detailed manner so everyone can do it because... there wasn't any docs in the first place and everyone should be able to do it on their own? However at the same time your complaining why your work is getting ignored for years? This sounds pretty elitist and will get us nowhere.

LocalIdentity commented 4 years ago

libtiff. You should be able to do that on your own.

I would like to be able to implement your changes but without some documentation, it' is going to be a much more lengthy process for us to build the SimpleGraphic dll and test it.

sthalik commented 4 years ago

Apologies for coming off unnecessarily harsh. Pull from the repo now. I included fresh dependencies (for Visual Studio 2019). Here are some instructions:

Dependencies:

All except luajit and giflib build easily with cmake. Most require zlib by themselves. libtiff doesn't need liblzma or anything else other than zlib. Expect to spend 4+ hours on preparing the build. 😢

Wires77 commented 4 years ago

FYI, we've made a fork under PoBCommunity here: https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic

Currently trying to see if we can get it to build everything from source more-or-less and auto-updating the DLL in PoB when it changes

zmike commented 4 years ago

Any update on this?

thisismydesign commented 4 years ago

GPU usage is also quite high.

image

Makes is quite painful to sue it while PoE is running. Not sure if many users are aware even.

ppoelzl commented 4 years ago

Fixed in 1.4.170.15.

zmike commented 3 years ago

This doesn't appear to be fixed. Either that or it's regressed. CPU and GPU usage very high both in foreground and background.