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.
| Function | Calls | Total Time |
| cellwrite | 1 | 67.579 |
| num2str | 100000 | 63.460 |
| int2str | 300000 | 20.366 |
| strvcat | 100000 | 6.325 |
| deblank | 100000 | 4.890 |
| num2str/lefttrim | 100000 | 4.524 |
| log10 | 100000 | 0.908 |
| profile | 1 | 0.000 |
cellwrite using strcat
| Function | Calls | Total Time |
| cellwrite | 1 | 120.000 |
| num2str | 100000 | 63.734 |
| strcat | 100000 | 51.539 |
| deblank | 398000 | 24.084 |
| int2str | 300000 | 19.959 |
| strvcat | 200000 | 11.902 |
| num2str/lefttrim | 100000 | 4.418 |
| log10 | 100000 | 1.166 |
| profile | 1 | 0.000 |
csvwrite
| Function | Calls | Total Time |
| dlmwrite | 1 | 67.688 |
| csvwrite | 1 | 67.688 |
| num2str | 100000 | 63.358 |
| int2str | 300000 | 20.514 |
| strvcat | 100000 | 6.360 |
| deblank | 100000 | 4.721 |
| num2str/lefttrim | 100000 | 4.301 |
| log10 | 100000 | 1.090 |
| profile | 1 | 0.000 |
Python Attempt One (cellwrite)
| Function | Calls | Total Time |
| <string> | 1 | 3.445 |
| cellwrite | 1 | 2.055 |
| isinstance | 100000 | 0.727 |
| append | 100000 | 0.594 |
| string/join | 2000 | 0.055 |
| join | 2000 | 0.023 |
| range | 1001 | 0.008 |
| write | 1000 | 0.008 |
| len | 2 | 0.000 |
| close | 1 | 0.000 |
| profiler | 1 | 0.000 |
Python Attempt Two (cellwrite2)
| Function | Calls | Total Time |
| <string> | 1 | 0.336 |
| cellwrite2 | 1 | 0.328 |
| map | 1000 | 0.258 |
| string/join | 1000 | 0.047 |
| join | 1000 | 0.031 |
| writelines | 1 | 0.000 |
| close | 1 | 0.000 |
| profiler | 1 | 0.000 |