frzyc / genshin-optimizer

An Artifact optimizer for Genshin Impact.
https://frzyc.github.io/genshin-optimizer/
MIT License
784 stars 233 forks source link

Extremely slow multi-target build time #1091

Closed StainAE86 closed 1 year ago

StainAE86 commented 1 year ago

I'm not sure if this is due to the latest fix with the builder or its just a poorly created multi-target but its very slow. Thought I'd bring it up since multi-targets are getting more popular and we've been promoting users leaving all artifact sets enabled as the default practice - and unless they drop the builds generated number down it will also default a higher number, 5 I think?

All sets, 10 builds: 3min 46s image

All sets, 1 build: 52s image

Emblem only, 1 build: 5s image

Full database: raiden multi.txt

StainAE86 commented 1 year ago

The user who brought this to attention says they noticed it around the 13th of this month.

Lines up with this merge: https://github.com/frzyc/genshin-optimizer/pull/1004 @tooflesswulf

tooflesswulf commented 1 year ago

Ah, this is somewhat expected. The LP bounding is significantly more computationally costly than the old method; however it gives a much tighter bound so we can prune more aggressively. But to properly take advantage of more aggressive pruning, we need to implement a proper branching method. I'm about half-way done in https://github.com/frzyc/genshin-optimizer/tree/heuristic-branching.

Aside from that, the bounding scales really badly in the number of dependent variables, which multi-opt for whatever reason adds a ton of. I noticed critrate & critdmg are duplicated like 10 times on the artifacts. I can also add a couple pre-processing steps to reduce the total number of variables (like merging flat atk and atk%).