In Octave 5.x and 6.x the implementation of sparse jacobians is very limited : the jacobian is treated as sparse but
the amount of memory allocated is sufficient to accomodate a full jacobian of the same size.
As a result the sparse jacobian is taken advantage in terms of speed (a bit) but not much in terms of memory footprint.
In Octave 7.x the implementation of the sparse jacobian is a bit better as a sparse matrix is created from the
beginning and memory is allocated only as needed. Yet the matrix is assembled from scratch at each time step
which is time consuming.
The 7.1 release is at least six months away (very optimistically) so this behaviour may still be improved before the release,
including possibly implementation of JPattern, but definitely there will be no improvement in time for the 6.1 release as new changes
have been pushed in the 7.0 branch until now.
As for speed differences with Matlab, it’s most likely not all dependent on the JPattern option, but rather mostly on the
Matlab Just in Time (JIT) compiler which significantly speeds up the evaluation of the code used to compute the jacobian and residual
at each iteration. That feature is missing in Octave and I don’t know of any plans to finish the current very limited implementation.
Hope this helps,