Shadows-of-Fire / FastSuite

A mod that increases recipe performance globally
MIT License
12 stars 3 forks source link

Only use parallel streams on known safe recipes #27

Open embeddedt opened 1 year ago

embeddedt commented 1 year ago

Since some recipe types/ingredients can throw CMEs, it is not safe to simply use a parallel stream on any recipe and call matches. This PR solves that issue by only applying parallelization to recipe types that are known to be safe. Currently, this is limited to vanilla recipe classes and ingredients, however even with such a strict check 96% of recipes are still parallelized in the ForgeCraft 1.20 pack.

Marked this as a draft since the code was written quickly and is intended to be a proof-of-concept.