Earlh21 / TaintedCainCrafter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Performance issues

TomasWilson opened this issue · comments

Performance gets very bad, the more items you add.
There are only ~11 Million recipes, so perhaps some caching of results could help.
Also, for some reason, the program seems to recalculate the results if you increase an items count that is already over 8. Obviously, no (new) recipes will be found from here, so no need to update the found ones.

Otherwise great program, keep it up!

I hadn't thought about it, but yeah, I could probably set up some kind of hash map from a recipe to its result, skipping the crafting calculation.

As for the second issue, it's still trying to iterate through new recipes (but not calculating any because it doesn't find any valid ones) when you increase the pickup amount. Simple solution, just return from the top of the method if old amount is 8 or greater.

I'll implement these changes sometime soon.