Fluorohydride / ygopro

A script engine for "yu-gi-oh!" and sample gui
GNU General Public License v2.0
1.84k stars 596 forks source link

Group.SelectSubGroup and Group.CheckSubGroup needs to be improved #2166

Closed purerosefallen closed 5 years ago

purerosefallen commented 5 years ago

qq 20181208225101 This afternoon I saw this on my server, in which the ygopro process ate up 46GB of my server memory, and an entire CPU core. After investigation, it was caused by those 2 functions checking large groups recursively. Currently the function is only checked after the whole recursive process. So when the group grows, like Chain Material or Future Fusion, the function would be checked the number equal to card count! times. This would ruin servers for eating up all memories, and result in server crash. https://github.com/Fluorohydride/ygopro-scripts/commit/742d610b33ab8192a02f1e877dd06569f0962cee is an improvement of this problem. However an ultimate solution to this is, to add a checking function in the middle of the recursive check. (See https://github.com/Fluorohydride/ygopro-scripts/pull/1123, but incomplete) This would cut down large useless recursive checks and improve the performance of the recursive subgroup check a lot. Any other solutions?

purerosefallen commented 5 years ago

qq 20181208225809

The above image is wrong. See this

purerosefallen commented 5 years ago

https://github.com/Fluorohydride/ygopro-scripts/pull/1129 Another solution is this, to store every combination. Now it can run with 20 cards without problem.