You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Description:
Jotunn.dll!Jotunn.Managers::InputManager.ZInput_GetButton() & Jotunn.dll!Jotunn.Managers::InputManager.ZInput_GetButtonDown() allocate trash (due to concatenation) potentially dozens of times per frame (especially if the critical flow of the mod depends on key presses... as it ofc does for OCDheim 😉). They allocate only ~60B per invocation, so this is more of "makes profiling more difficult to analyze" than "performacne issue".
Expected Behaviour:
I would hope there to be no allocation 😉. If given guidance on prefered implementation - I'm perfectly willing to provide a PR.
The text was updated successfully, but these errors were encountered:
java-devil
changed the title
[BUG]
[BUG] Unnecessary allocation in ZInput.GetButtion() & ZInput.GetButtonDown()
Jan 16, 2023
Yes, I also don't think the impact on performance is that high, otherwise we likely would have noticed it before. But without dedicated profiling, I cannot say this with full certainty. So yeah, it makes sense to change the calls to allocate less memory if possible and has some impact.
If you want to provide a PR this is perfectly fine. As it doesn't seem to have a high priority, I (and probalby Jules, too) won't get to it in the short term.
The last major changes to the input system were with the mmhook remove. Porting the hooks to Harmony required some things like reverse patching, but I didn't evaluate if that was the best solution at the time. It was one of the more difficult ports and getting it to work at all was more important.
So I think a rework of the interal systems are appropriate anyway, but if you only want to fix the string concatination allocation this is alright of course. In general, everything that is done without changing the public API is fine, this means both public interfaces and functioning wise. In the case of the input system, if it works slightly different but still makes and doesn't break mods it's also okay I would say. But this must be evaluated if it occurs.
Details:
Jotunn Version: 2.10.3
Jotunn Submodule(if applicable): InputManager
Repeatability(Consistent(100%), Inconsistent(50%), Rare(1%), Unknown(==1)): 100%
Problem Description:
Jotunn.dll!Jotunn.Managers::InputManager.ZInput_GetButton() & Jotunn.dll!Jotunn.Managers::InputManager.ZInput_GetButtonDown() allocate trash (due to concatenation) potentially dozens of times per frame (especially if the critical flow of the mod depends on key presses... as it ofc does for OCDheim 😉). They allocate only ~60B per invocation, so this is more of "makes profiling more difficult to analyze" than "performacne issue".
Expected Behaviour:
I would hope there to be no allocation 😉. If given guidance on prefered implementation - I'm perfectly willing to provide a PR.
The text was updated successfully, but these errors were encountered: