matlab_fast_2012_fsu
matlab_fast_2012_fsu,
"Maximum MATLAB",
a talk about measuring and improving
the performance of MATLAB programs, given to the class
on Symbolic and Numeric Computations, in the Department of
Scientific Computing at Florida State University,
5/7 November 2012.
The talk is intended for users who are comfortable with writing small
scripts and functions in MATLAB, but who want to understand why some
programs seem to take much longer to run than expected.
We'll look at how sensible ways to try to time a MATLAB program,
try to guess what the "maximum speed" of a MATLAB program could be,
and consider the relationship between the size, difficulty, and
completion time for a program.
We'll look at some simple operations in MATLAB that you can
unintentionally program to run very slowly. We'll see that the
MATLAB editor has a built-in feature for detecting some of these
slow spots and helping you to fix them. We will explore the ways
that MATLAB allows you to use vector and matrix notation that
can result in very fast execution of your programs.
-
array1.m,
sets up an MxN array, somewhat carelessly.
-
array1_first.png,
graphs the execution time for the ARRAY1 program, run once.
-
array1_once.m,
computes and times the array once.
-
array1_second.png,
graphs the execution time for the ARRAY1 program, run a second time.
-
array1_twice.m,
computes the array twice, and times the second computation.
-
array1_twice.png,
graphs the execution time for the ARRAY1 program, run twice in a row.
-
array1_vector.m,
compares a for loop and a vectorized approach.
-
cheetah_running.png,
a high-performance cheetah.
-
dot_for_graph.m,
measures the time and rate of the for-loop
dot product calculation.
-
dot_for_rate_graph.png,
graphs the computational rate for the for-loop
dot product calculation.
-
dot_for_time_graph.png,
graphs the elapsed time for the for-loop
dot product calculation.
-
dot_forplus_graph.m,
measures the time and rate of the "fattened" for-loop
dot product calculation.
-
dot_forplus_rate_graph.png,
graphs the computational rate for the "fattened" for-loop
dot product calculation.
-
dot_forplus_time_graph.png,
graphs the elapsed time for the "fattened" for-loop
dot product calculation.
-
dot_product_graph1.png,
graphs the execution time for the dot product calculation.
-
dot_product_graph2.png,
graphs the execution time for the dot product calculation
when we include much larger problems.
-
dot_vector_graph.m,
measures the time and rate of the vectorized
dot product calculation.
-
dot_vector_graphs.m,
measures the time and rate of the for-loop
dot product calculation, 5 trials.
-
dot_vector_rate_graph.png,
graphs the computational rate for the vectorized
dot product calculation.
-
dot_vector_rate_graphs.png,
graphs the computational rate for the vectorized
dot product calculation, 5 trials.
-
dot_vector_time_graph.png,
graphs the elapsed time for the vectorized
dot product calculation.
-
dot_vector_time_graphs.png,
graphs the elapsed time for the vectorized
dot product calculation, 5 trials.
-
f1.m,
defines a function f1(x,y).
-
f2.m,
defines a function f2(x,y) using vectorized notation.
-
fgrid.png,
an illustration of the use of a computational grid to
display a function z(x,y).
-
fsu_logo.pdf,
a logo for FSU.
-
marathon.png,
a marathon runner who's had enough.
-
min1.m,
seeks the minimum of function f1.
-
min2.m,
seeks the minimum of function f2 using vectorized notation.
-
min3.m,
seeks the minimum of function f2 using vectorized notation
and "chunking".
-
please_wait.png,
a highly-efficient computer asking its user to wait.
-
r8_log_2.m,
computes the logarithm base 2 of a real number.
-
sgtsl.m,
solves a tridiagonal linear system.
-
sgtsl_vs_sparse.m,
compares sgtsl() and sparse().
-
sparse.png,
sparse attendance at a basketball game.
-
sparse_lake.png,
the finite element grid used to discretize a lake.
-
sparse_matrix.png,
the sparsity pattern in the finite element matrix.
-
speedometer.png,
a speedometer.
-
ticker.m,
times the operation of setting a 1000x1000 random matrix.
-
too_many_boxes.png,
trying to store things a bit chaotically.
Last revised on 12 February 2024.