-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
Description
ConstraintSet.varkeys is slow. This affects Model.__getitem__. Is there any way we could store Model._varkeys and have a boolean flag that gets set by other methods when the varkeys need to be recomputed? Otherwise, I end up storing the varkeys and then accessing those instead of the model, to prevent multiple calls to varkey.
Timing example from a model with only ~400 variables:
In [18]: t = time.time(); (M["C_L"], M["C_D"]); print time.time() - t
2.10050082207
In [19]: t = time.time(); mvk = M.varkeys; (mvk["C_L"], mvk["C_D"]); print time.time() - t
1.06283092499Reactions are currently unavailable