Custom Generic Arguments field causes performance degradation #17

Closed
opened 2024-05-04 02:03:32 -05:00 by brecert · 3 comments
brecert commented 2024-05-04 02:03:32 -05:00 (Migrated from github.com)

CherryPick's generic arguments field lags significantly compared to without the mod.

I think CherryPick may be checking if the type is valid every frame as more complex types cause more lag and every node browser with types in the generic arguments field affect it.

An easy way to reproduce this is to use IValue<IValue<IValue<IValue<IValue<IValue<IValue<IValue<IValue<IValue<IValue>>>>>>>>>> as the generic custom arguments for WriteDynamicObjectVariable.

On my system it degrades the engine update time to ~30fps, compared to without the mod where it's ~275fps.

CherryPick's generic arguments field lags significantly compared to without the mod. I think CherryPick may be checking if the type is valid every frame as more complex types cause more lag and every node browser with types in the generic arguments field affect it. An easy way to reproduce this is to use `IValue<IValue<IValue<IValue<IValue<IValue<IValue<IValue<IValue<IValue<IValue>>>>>>>>>>` as the generic custom arguments for `WriteDynamicObjectVariable`. On my system it degrades the engine update time to ~30fps, compared to without the mod where it's ~275fps.
BlueCyro commented 2024-05-04 13:34:21 -05:00 (Migrated from github.com)

Please provide logs, make sure your RML is up to date and make sure CherryPick is up to date.

Please provide logs, make sure your RML is up to date and make sure CherryPick is up to date.
BlueCyro commented 2024-05-04 17:36:12 -05:00 (Migrated from github.com)

Just as an FYI, I was able to replicate this, but please do remember to include those in the future. This appears to be another case of voodoo magic that I've run into, and is potentially related to #10.

The running theory I have is that reflecting all of the types in the game causes a cache buildup somewhere, and that cache is hit whenever certain parts of reflection are used. This is going to prove hard to diagnose, so don't expect an immediate fix.

Just as an FYI, I was able to replicate this, but please do remember to include those in the future. This appears to be another case of voodoo magic that I've run into, and is potentially related to #10. The running theory I have is that reflecting all of the types in the game causes a cache buildup somewhere, and that cache is hit whenever certain parts of reflection are used. This is going to prove hard to diagnose, so don't expect an immediate fix.
BlueCyro commented 2024-06-30 22:31:15 -05:00 (Migrated from github.com)

I changed up how CherryPick populates its component cache, and this should be far less of an issue now. Give release 1.1.0 a shot and tell me how it goes! If all is well, I'll close up this issue.

I changed up how CherryPick populates its component cache, and this should be far less of an issue now. Give [release 1.1.0](https://github.com/BlueCyro/CherryPick/releases/tag/1.1.0) a shot and tell me how it goes! If all is well, I'll close up this issue.
cyro closed this issue 2025-08-21 00:33:40 -05:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: cyro/CherryPick#17
No description provided.