Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Performance "AIM cache filter function once"
Purpose of change
Fitler functions can be separated into two phases, preparation and run, example:
preparation
Cataclysm-DDA/src/item_search.cpp
Lines 92 to 106 in 52e00eb
run
Cataclysm-DDA/src/item_search.cpp
Lines 107 to 115 in 52e00eb
I thought it AIM executes the preparation once, but it does not. So I am making it so.
I want to do filter functions with expansive preparation like here #78384 but for AIM. Without this, the game slows down to a crawl.
Describe the solution
set_filter
and always updates the filter function.Describe alternatives you've considered
Testing
The test is in this save
TEST AIM move.zip
Move the things through AIM with filters
v:h
on both panes.To measure the performance, place breakpoint A here
Cataclysm-DDA/src/advanced_inv.cpp
Line 1012 in 52e00eb
breakpoint B here
Cataclysm-DDA/src/advanced_inv.cpp
Line 1912 in 52e00eb
Additional context
I went through the View menu (Look around), it seems to do the preparation part only once.