|
def __init__(self, model=None): |
|
self.problem = None |
|
self.var_ids = [] |
|
self.constr_ids = [] |
|
self.model = model |
Will make add_variable to have performance regression if over 40k variables are added into the problem, and adding 200k variables will have 10mins overhead due to the query of a python list is O(n):

While replacing it with set() will make it done within a second as the set is O(1) complexity:

reframed/reframed/solvers/solver.py
Lines 36 to 40 in 1927419
Will make
add_variableto have performance regression if over 40k variables are added into the problem, and adding 200k variables will have 10mins overhead due to the query of a pythonlistisO(n):While replacing it with
set()will make it done within a second as thesetisO(1)complexity: