Chris, I looked at the output of JumpProblem, and here it is for a graph of 5 vertices and 10 edges. Imagine how long it would be when the graph has 20,000 vertices and 200,000 edges. Of course, I should not print it. But here is the source of inefficiencies. The equations are stored as an array of equations and I would not be surprised if that led to cache problems:
MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(γ₂, Pair{Operation,Int64}[I₂ => 1], Pair{Operation,Int64}[I₂ => -1, R₂ => 1]),
Below is the output from JumpProblem, which must be processed by DiscreteEquations. Could you point me to the specific function called in DiffEqBase when calling DiscreteProblem? I understand that types are handled very efficiently, but processing this complex datastructure for a complex graph must take lots of time.
JumpSystem{RecursiveArrayTools.ArrayPartition{DiffEqJump.AbstractJump,Tuple{Array{MassActionJump,1},Array{ConstantRateJump,1},Array{VariableRateJump,1}}}}
js= JumpSystem{RecursiveArrayTools.ArrayPartition{DiffEqJump.AbstractJump,Tuple{Array{MassActionJump,1},Array{ConstantRateJump,1},Array{VariableRateJump,1}}}}(MassActionJump[MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₁, Pair{Operation,Int64}[I₁ => 1, S₂ => 1], Pair{Operation,Int64}[I₂ => 2, S₂ => -1, I₁ => -1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₂, Pair{Operation,Int64}[I₁ => 1, S₄ => 1], Pair{Operation,Int64}[S₄ => -1, I₄ => 2, I₁ => -1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₃, Pair{Operation,Int64}[I₂ => 1, S₃ => 1], Pair{Operation,Int64}[I₂ => -1, I₃ => 2, S₃ => -1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₄, Pair{Operation,Int64}[I₂ => 1, S₅ => 1], Pair{Operation,Int64}[I₂ => -1, S₅ => -1, I₅ => 2]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₅, Pair{Operation,Int64}[I₃ => 1, S₂ => 1], Pair{Operation,Int64}[I₂ => 2, S₂ => -1, I₃ => -1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₆, Pair{Operation,Int64}[I₃ => 1, S₅ => 1], Pair{Operation,Int64}[S₅ => -1, I₃ => -1, I₅ => 2]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₇, Pair{Operation,Int64}[I₄ => 1, S₂ => 1], Pair{Operation,Int64}[I₂ => 2, I₄ => -1, S₂ => -1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₈, Pair{Operation,Int64}[I₄ => 1, S₅ => 1], Pair{Operation,Int64}[S₅ => -1, I₄ => -1, I₅ => 2]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₉, Pair{Operation,Int64}[I₅ => 1, S₂ => 1], Pair{Operation,Int64}[I₂ => 2, S₂ => -1, I₅ => -1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(β₁₀, Pair{Operation,Int64}[I₅ => 1, S₄ => 1], Pair{Operation,Int64}[S₄ => -1, I₄ => 2, I₅ => -1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(γ₁, Pair{Operation,Int64}[I₁ => 1], Pair{Operation,Int64}[R₁ => 1, I₁ => -1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(γ₂, Pair{Operation,Int64}[I₂ => 1], Pair{Operation,Int64}[I₂ => -1, R₂ => 1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(γ₃, Pair{Operation,Int64}[I₃ => 1], Pair{Operation,Int64}[R₃ => 1, I₃ => -1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(γ₄, Pair{Operation,Int64}[I₄ => 1], Pair{Operation,Int64}[I₄ => -1, R₄ => 1]), MassActionJump{Operation,Array{Pair{Operation,Int64},1},Array{Pair{Operation,Int64},1}}(γ₅, Pair{Operation,Int64}[I₅ => 1], Pair{Operation,Int64}[R₅ => 1, I₅ => -1])]ConstantRateJump[]VariableRateJump[], t, Variable[S₁, S₂, S₃, S₄, S₅, I₁, I₂, I₃, I₄, I₅, R₁, R₂, R₃, R₄, R₅], Variable[β₁, β₂, β₃, β₄, β₅, β₆, β₇, β₈, β₉, β₁₀, γ₁, γ₂, γ₃, γ₄, γ₅], Symbol("##ReactionSystem#375"), JumpSystem[])