CovertLab / wcEcoli

Whole Cell Model of E. coli
Other
18 stars 3 forks source link

Optimize 2CS and equilibrium rate functions #1413

Closed thalassemia closed 7 months ago

thalassemia commented 7 months ago

Testing (see discussion) revealed that constructing sparse arrays with a series of arr[i,j] = k expressions is faster than using a monolithic np.array([[...], [...], ...]) expression.

Ultimately, this proved to be a purely academic distinction. On Python 3.11, python runscripts/manual/runSim.py completes a cell cycle ~1% faster (~15 sec) with this change LOL.

This also fixes the long JIT compilation time bug documented in #1400. Unfortunately, running with --jit was still 1 second slower than with --no-jit.