PathOfBuilding icon indicating copy to clipboard operation
PathOfBuilding copied to clipboard

Show Node Power & Power Report Incredible Slow or Infinite

Open Reithan opened this issue 3 years ago • 13 comments

  • What were you trying to do? Trying to view node power for a variety of stats - including "Energy Shield Leech"
  • What happened? Node powers stay black and the interface continues responding slowly as if calculating, but never finished. Node Power report is either blank, or crashes when opened. Task manager doesn't report any CPU or GPU usage over 0% from PoB.
  • What steps will reproduce the bug? Open a build, select "Show Node Power", and select "Energy Shield Leech"
  • Does it reproduce every time? Yes
  • Provide a build code: https://pastebin.com/HCbsNjnk
  • Screenshots: image

Reithan avatar Jul 25 '21 21:07 Reithan

Make sure PoB is in the foreground while it's calculating. We introduced a way to limit the CPU PoB uses when in the background, but unfortunately that slowed down our calculations as well.

Wires77 avatar Aug 09 '21 01:08 Wires77

While it does run substantially slower or not at all while in background, I'm still seeing very slow calculation in the foreground, and the task manager report is about the same even with the POB window selected.

HOWEVER, I can DRASTICALLY speed up the calculation by spam-clicking in the passive tree area or rapidly dragging it around.

It seems like whatever detection is being used to throttle POB isn't correctly detecting when it's focused and only when it's be actively interacted with?

Reithan avatar Aug 09 '21 19:08 Reithan

Please don't throttle PoB. That is a horrible idea. If some thing are slow, those need to be worked out individually. There is zero reason PoB should take as long as it does on many things. At minimum, that needs to be turn off-able, but I am firmly on the side of that being just a very wrong direction to go.

jnordwick avatar Sep 06 '21 17:09 jnordwick

It's an artifact of the subscript (off-thread) architecture of the SimpleGraphic engine for background Lua code, where cross-thread calls into the main interpreter are processed as a step in the render loop.

The render loop is what's capped when in the background and vsync:ed when in the foreground, to avoid PoB from competing for GPU and CPU cycles with the foreground applications you really care about, typically the game itself.

As you swap your buffers, you're blocked and don't process window messages nor poll the subscript queue, so there's not much of an easy fix to be made and uncapping has significant drawbacks.

Could it be rearchitectured in some way to be more decoupled and a bit more event-driven? Possibly. Has anyone taken on that huge task? Nah.

zao avatar Sep 06 '21 17:09 zao

It didn't used to be this bad though. Something changed.

Reithan avatar Sep 06 '21 18:09 Reithan

@zao afaik node power calc does not use subscripts tho. it uses plain lua coroutines and therefore does nothing at all when the render loop is paused and the sync topic is irrelevant for this case.

Fish013 avatar Apr 16 '22 21:04 Fish013

@Fish013 Good catch, it's in coroutines which run interspersed in the main thread of execution. If there is time spent in a limiter or in vsync that also affects the amount of Lua code that gets run. While it ends up blocked on different things than subscripts, it's still affected by the render loop throughput, relying on the OnFrame calls being serviced rather than SubScriptFrame calls.

The relevant lines of code for the governor are the following, sandwiched around subscript and frame calls: https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/blob/9eb5ba6b0b930075a4d30ca685eecb4e67c71b24/ui_main.cpp#L374-L385

https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/blob/9eb5ba6b0b930075a4d30ca685eecb4e67c71b24/ui_main.cpp#L428-L430

There's some circumstances where we bail on the render loop but focus or cursor hovers alone should suffice to prevent that state.

As for OP's slow experience with computation, it could be that the coroutines feel pressured to yield without getting much work done, or the resumer opting to not resume them - that depends entirely on how the Lua code around them is structured and whether it depends on wall time or frame call frequency.

zao avatar Apr 16 '22 22:04 zao

What about option to disable background throttling at all? It's really displeasing to be forced to look at empty screen for a few minutes

test544 avatar Jul 22 '22 09:07 test544

Worse, if you click off the window to do something else while you wait, or don't constantly drag the screen around, it takes multiple times as long (or possibly just stops?).

So, not only does it take a nonsensical amount of time, it also requires constant babysitting.

Reithan avatar Aug 24 '22 03:08 Reithan

Almost a year and a half, and this is still unresolved. This, for me, makes the tool pretty much useless. It's been about 2 years since I played much, but it has gone from "barely usable" since earlier last year to "entirely broken" recently. As an example, I waited 26 minutes (well, 25 minutes, 58 seconds) staring at the PoB screen, 26 minutes on a 5-month old gaming computer, and nothing meaningful happened. It just sat there, black as pitch on every node. I gave up. Just like I did the last time, where I waited about 15 minutes before just closing the tool, closing PoE, and giving up.

This is absolutely not the experience we used to have with this tool. What's going on that this issue has gotten progressively worse for so long, and has had no actual resolution?

darkpoetcc avatar Dec 02 '22 15:12 darkpoetcc

There is currently a bug where the offence/defence doesn't work and will remain black. This is fixed in dev and probably what you observed in this case.

QuickStick123 avatar Dec 03 '22 02:12 QuickStick123

It's super annoying that this is still so slow, because it also doesn't progress at all if you're alt-tabbed. So I literally just have to sit there and stare at nodes updating for 5-10 minutes every time I make a change

Reithan avatar Dec 03 '22 02:12 Reithan

Are there any search options in particular you find super slow? Or is it just full dps with many skills.

QuickStick123 avatar Dec 03 '22 02:12 QuickStick123

bump. With all the recent preformance updates, is it still not solvable? I'm think it's the only significant inconvenient thing with pob right now.

test544 avatar Mar 24 '24 07:03 test544