perf: lazily compute PreviewBuilder state#1207
perf: lazily compute PreviewBuilder state#1207SirYwell wants to merge 1 commit intorefinedmods:developfrom
Conversation
|
@raoulvdberge what do you think of this in general? Currently the order is different, I didn't take a closer look if that can be fixed easily. But it seems to be faster and would render the PreviewCraftingCalculatorListener and related code unnecessary. |
|
No, I'm not a fan of this. The code should match the intent, and now you are reusing tree code for list code because it is faster. I'd like to know WHY it's faster, and use that knowledge to improve the list code. I have no problem with having both list and tree code. For me the ordering in the list is important. I don't want the list view to become dependant on the tree view, the whole listener system is set in place to avoid that. |
|
Understandable. Maybe the concept can be used for PreviewBuilder too, e.g., remember the relevant |
4117ee3 to
56ea26b
Compare
|
I now reworked the implementation of I didn't test this beyond existing unit tests for now. I also didn't profile it. |
Trying to re-use TreePreviewCraftingCalculatorListener to calculate the normal Preview too, as that seems to have better performance characteristics.