-
Notifications
You must be signed in to change notification settings - Fork 15
NLEIGS MATLAB vs Julia
MacBook Pro, Intel i7-6920HQ, 2.90GHz, 2x4 cores, 16 GB memory
MATLAB: v8.4.0 (R2014b)
Julia: v1.0.2
MATLAB: v0.5 from this page
Julia: master branch as of 2018-11-15 (commit 44a2fc6)
Each experiment was run 10 times, with minimum display level, and the fastest run is reported. Only the solver is timed, not creating the input data.
In MATLAB, memory usage was measured by summing up all the variables at the end of solver (mem = 0; for w = whos'; mem = mem + w.bytes; end
), including the cached LU factors (in Alu
).
In Julia, Base.summarysize(obj)
was used.
Number of iterations required for convergence may vary a bit due to different start vectors and tiny rounding errors that build up over time. Columns 2-5 refer to the MATLAB version, and columns 6-9 refer to the Julia version. The big reduction in memory usage in Julia vs MATLAB for the Gun problem is largely due to the more efficient way that the Julia version stores the cached LU factors.
Experiment | # Iter | # Conv. λ | CPU time | Memory | # Iter | # Conv. λ | CPU time | Memory |
---|---|---|---|---|---|---|---|---|
Gun P | 100 | 17 | 7.1 s | 420 MB | 100 | 17 | 4.3 s | 59 MB |
Gun R1 | 100 | 21 | 7.7 s | 421 MB | 100 | 21 | 4.3 s | 59 MB |
Gun R2 | 95 | 21 | 22.7 s | 413 MB | 95 | 21 | 14.1 s | 51 MB |
Gun S | 70 | 21 | 6.0 s | 408 MB | 71 | 21 | 3.9 s | 46 MB |
Particle R2 | 78 | 2 | 19.7 s | 213 MB | 74 | 2 | 8.7 s | 73 MB |
Particle S | 141 | 2 | 15.1 s | 239 MB | 134 | 2 | 6.5 s | 92 MB |