Skip to content

perf: Optimize imbuement handling and item lookup - #959

Open
jprzimba wants to merge 1 commit into
mainfrom
imbuements
Open

jprzimba wants to merge 1 commit into
mainfrom
imbuements

Conversation

@jprzimba

Copy link
Copy Markdown
Collaborator
  • Iterate equipped slots directly instead of building a per-tick map (removes getAllSlotItems from header and source) to avoid allocations and improve performance.
  • Simplify Item::getImbuementInfo by caching the CustomAttribute lookup, returning early if missing, and extracting the stored info without redundant calls.
  • Minor cleanup related to these changes.

- Iterate equipped slots directly instead of building a per-tick map (removes getAllSlotItems from header and source) to avoid allocations and improve performance.
- Simplify Item::getImbuementInfo by caching the CustomAttribute lookup, returning early if missing, and extracting the stored info without redundant calls.
- Minor cleanup related to these changes.
@iloveShaders

Copy link
Copy Markdown
Contributor

that looks interesting... will test it today and give a feedback in 12h or so.

@iloveShaders

Copy link
Copy Markdown
Contributor

yup the performance is noticeable seems much better but noticed one issue that i dont know if it is related but npcs seems to ignore imbuements and despite having unchecked the "Sell Equipped" they buy equipped items, not for every player it seems random case tho.

@jprzimba

jprzimba commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

yup the performance is noticeable seems much better but noticed one issue that i dont know if it is related but npcs seems to ignore imbuements and despite having unchecked the "Sell Equipped" they buy equipped items, not for every player it seems random case tho.

will check, thank you for feedback

@jprzimba

jprzimba commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

yup the performance is noticeable seems much better but noticed one issue that i dont know if it is related but npcs seems to ignore imbuements and despite having unchecked the "Sell Equipped" they buy equipped items, not for every player it seems random case tho.

In my tests, I didn't encounter any issues related to "Sell Equipped", it only sells the item when the option is actually checked. I tested with both compiled branches "main" and "imbuements" using their respective executables, and the results were the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants