Francis Barnhart

Home / Writing Mixed Data With MATLAB /

Profiler Results

Tuesday, June 29th, 2004

Profiler results for CSVWRITE and CELLWRITE, MATLAB functions to write numerical and mixed data respectively to CSV files. Python results are shown for comparison.

All results are for a single 1000 by 100 matrix of random numbers.

cellwrite

FunctionCallsTotal Time
cellwrite167.579
num2str10000063.460
int2str30000020.366
strvcat1000006.325
deblank1000004.890
num2str/lefttrim1000004.524
log101000000.908
profile10.000

cellwrite using strcat

FunctionCallsTotal Time
cellwrite1120.000
num2str10000063.734
strcat10000051.539
deblank39800024.084
int2str30000019.959
strvcat20000011.902
num2str/lefttrim1000004.418
log101000001.166
profile10.000

csvwrite

FunctionCallsTotal Time
dlmwrite167.688
csvwrite167.688
num2str10000063.358
int2str30000020.514
strvcat1000006.360
deblank1000004.721
num2str/lefttrim1000004.301
log101000001.090
profile10.000

Python Attempt One (cellwrite)

FunctionCallsTotal Time
<string>13.445
cellwrite12.055
isinstance1000000.727
append1000000.594
string/join20000.055
join20000.023
range10010.008
write10000.008
len20.000
close10.000
profiler10.000

Python Attempt Two (cellwrite2)

FunctionCallsTotal Time
<string>10.336
cellwrite210.328
map10000.258
string/join10000.047
join10000.031
writelines10.000
close10.000
profiler10.000
francis@francisbarnhart.com

Copyright © 2000-2005 by Francis Barnhart.