Closed bell07 closed 5 years ago
The searches
cache is here to avoid looping through all items if the result is known (after 2 searches). Your changes force looping whatsoever, so explain me why the cache isn't useful anymore?
Interested for something similar in craftguide?
Yes.
I started the work on this before I seen you work on API function too.
Now I will test your canges and if your PR is well-tested and merged, I rebase this PR and look for further optimizations.
EDIT: shortly tested your work, there is a performance boost in progressive ;-) beter then my changes in this PR
Ok, this PR is pointless now since #46 is merged. If I see further optimizations I create new PR. Thank you for your support. Now I understand little more how the craftguide work
In preparation to get the progressive-mode replaceable, and to understand how the mod work I did some optimizations.
Main change is: The text-filter is applied at the first now, and the progressive filter at the second. The goal is to improve performance for high items volume (I test with my whynot game). Therefore no data.init_filter_items or searches[] cache usefull anymore. My changes did improved the performance for me. But I look for further performance optimizations.
By the way, in smart_inventory I pre-analyze all recipes at server-boot and cache needed informations in lua tables for faster access. Interested for something similar in craftguide?