I assume that your networks are sparse (most entries of the adjacency matrix are zero) and irregular (no grids and similar repeating structures).
As an example, let’s look at an ODE: $\dot{x} = f(x).$
Solving this can be dissected into evaluating $f$ and the ODE solver.
The latter can be completely vectorised, and thus you can expect efficient implementations in any programming language suited for scientific computations, including Python.
Thus, your problem boils down to efficiently evaluating $f$.
Now, for things like partial differential equations or if your network is a grid, this can again be efficiently vectorised, e.g., using NumPy or Numba.
However, for complex networks, this is not possible, since there is no regular structure.
This leaves you with two options:
Using sparse-matrix representations for your network’s adjacency matrix. This is usually easy to implement, but cannot be applied to every problem and it also can have a considerable overhead.
Use some meta-programming tool (code that writes code) to hardcode your network dynamics in an efficient manner. The created code would be in a low-level language like C, and ideally be operated it from a high-level language like Python. There are also dedicated tools for this.
I wrote one of the latter tools: JiTCODE.
Very briefly, it takes your ODE in symbolic form, converts it to C code, compiles that, and loads it back into Python for ODE solving.
In the accompanying paper (preprint), I also discuss the numerical challenges in detail. For problems other than differential equations, similar thoughts apply:
You need to either meta-program your network structure or exploit existing sparse-matrix solutions.
Some specific remarks:
But Python is generally much slower than most languages […]
Note that while pure Python code is slow, the way to go is usually to implement the bottleneck in a low-level language like C and operate this from Python.
This is for example what NumPy does.
NetworkX doesn’t do this (at least the last time I checked), which is why it’s so slow.
is incompatible with external libraries like NetworkX
You probably won’t be able to find a library that directly integrates NetworkX, but rather need to export your network as a NumPy array or similar.
However, given that you usually won’t have an interaction between the two, I don’t see this as a big problem.
In general, the problem of generating and analysing networks and running dynamics on them are rather distinct, so I don’t see much of a benefit from integrating all of this into one library.