UnknownX7 / NoClippy

A XIVLauncher plugin.
129 stars 36 forks source link

Brief freeze at the end of encounter on WINE #51

Open Uragawa opened 1 year ago

Uragawa commented 1 year ago

I noticed this experimenting with the code locally after the latest Dalamud update, but just confirmed that it happens in the official version. It has been tested with no other plugins enabled. There's a good chance this issue doesn't affect Windows users, and the problem is all but certain to originate upstream, but for the time being this is reliably causing a brief freeze at the end of every encounter (unless you don't use actions on the enemy at all). It doesn't seem to scale with encounter duration. These are shown in the Dalamud log:

2023-10-05 21:39:29.537 -03:00 [WRN] [HITCH] Long FrameworkUpdate detected, 489.8426ms > 50ms - check in the plugin stats window.
2023-10-05 21:41:46.048 -03:00 [WRN] [HITCH] Long FrameworkUpdate detected, 269.0844ms > 50ms - check in the plugin stats window.
2023-10-05 21:49:58.297 -03:00 [WRN] [HITCH] Long FrameworkUpdate detected, 331.1141ms > 50ms - check in the plugin stats window.
2023-10-05 21:52:44.592 -03:00 [WRN] [HITCH] Long FrameworkUpdate detected, 574.4648ms > 50ms - check in the plugin stats window.
2023-10-05 21:53:14.920 -03:00 [WRN] [HITCH] Long FrameworkUpdate detected, 298.9962ms > 50ms - check in the plugin stats window.
2023-10-05 21:56:41.421 -03:00 [WRN] [HITCH] Long FrameworkUpdate detected, 393.5624ms > 50ms - check in the plugin stats window.
2023-10-05 22:01:41.565 -03:00 [WRN] [HITCH] Long FrameworkUpdate detected, 571.0313ms > 50ms - check in the plugin stats window.
2023-10-05 22:02:25.349 -03:00 [WRN] [HITCH] Long FrameworkUpdate detected, 516.7646ms > 50ms - check in the plugin stats window.

It should be noted that this is all on HDD; I can't say whether it's noticeable on SSD.

grantwwu commented 1 year ago

I am having the same issue. I am on Windows and have an SSD. This reproduces in the overworld as well; if you pull a mob and kill it, leaving combat, the hitch occurs. If you pull two mobs and kill one, the hitch doesn't occur. If you later kill the second, it occurs.

I was able to reproduce this with every other plugin disabled on a fresh /xlrestart.

weeviltime commented 1 year ago

For both commenters, I also experiencing this problem, @grantwwu are you using DXVK in your Windows?

I ask because my friend uses NoClippy but has no problem, maybe its something with Vulkan only?

grantwwu commented 1 year ago

I'm not using DXVK as far as I'm aware

Uragawa commented 1 year ago

On Linux, the suspected culprit is sqlite, which has been introduced into the serialisation flow as of v9. I've been running a self-edited version of NoClippy without the serialisation call in the middle of the update cycle and that solves the problem for me, though it likely kills long-term statistics. I'm also experiencing slowdowns (sometimes hitches, but mostly violent fps drops) in certain parts of the plugin installer which are most likely calling serialisation as well.

weeviltime commented 1 year ago

Thanks @Uragawa, I'll try the same on my side and recompile without those serializations.

grantwwu commented 1 year ago

On Linux, the suspected culprit is sqlite, which has been introduced into the serialisation flow as of v9. I've been running a self-edited version of NoClippy without the serialisation call in the middle of the update cycle and that solves the problem for me, though it likely kills long-term statistics. I'm also experiencing slowdowns (sometimes hitches, but mostly violent fps drops) in certain parts of the plugin installer which are most likely calling serialisation as well.

Is the introduction of sqlite Linux specific?

Uragawa commented 1 year ago

Is the introduction of sqlite Linux specific?

Nope, it's general. Apparently there have been other reports of performance issues on Linux following the change though.

Uragawa commented 3 months ago

Reporting that this is unfortunately not fixed upstream as of the current incarnation of API 10, please give affected users a way to skip that write or move it out of the framework update loop if that's a possibility.

UnknownX7 commented 3 months ago

I've gone ahead and changed it to only save while changing areas. I know its not exactly a real solution, but I'd prefer if Dalamud would fix this or provide an alternative for developers to use to avoid the problem. However, I am open to revisiting this in the future if it is still bothering people and Dalamud can't/won't fix it.