CodeTools[Profiling] - Maple Programming Help

Home : Support : Online Help : Programming : Profiling : CodeTools[Profiling] : CodeTools/Profiling/Merge

CodeTools[Profiling]

 Merge
 merge tables of profiling data into a single table

 Calling Sequence Merge(tab1, tab2, ..., filename1, filename2, ...)

Parameters

 tab1, tab2, ... - (optional) table filename1, filename2, ... - (optional) filename

Description

 • The Merge(tab1, tab2, ...) command combines the specified tables, tab1, tab2, ..., of profiling data together into a single table.
 • The Merge(filename1, filename2, ...) command reads the profiling data from the specified files, filename1, filename2, ..., and combines it into a single table.
 • The Merge(tab1, tab2, ..., filename1, filename2, ...) command reads the profiling data from the specified tables, tab1, tab2, ..., and the specified files, filename1, filename2, ..., and combines it into a single table.
 • Procedures that appear more than once have their data summed.
 If no parameters are specified, Merge raises an error.

Examples

 > a := proc(x)     if (x > 1) then         return 1;     else         return 0;     end if; end proc:
 > $\mathrm{with}\left(\mathrm{CodeTools}[\mathrm{Profiling}]\right):$
 > $\mathrm{t1}≔\mathrm{Build}\left(\mathrm{procs}=a,\mathrm{commands}='a\left(0\right)',\mathrm{commands}='a\left(2\right)'\right)$
 ${\mathrm{t1}}{≔}{\mathrm{table}}\left(\left[{\mathrm{_Inert_ASSIGNEDNAME}}{}\left({"a"}{,}{"PROC"}\right){=}\left[\begin{array}{rrr}{2}& {0}& {6}\\ {2}& {0}& {6}\\ {1}& {0}& {0}\\ {1}& {0}& {0}\end{array}\right]\right]\right)$ (1)
 > $\mathrm{PrintProfiles}\left(\mathrm{t1}\right)$
 a a := proc(x)      |Calls Seconds  Words| PROC |    2   0.000      6|    1 |    2   0.000      6| if 1 < x then    2 |    1   0.000      0|   return 1                             else    3 |    1   0.000      0|   return 0                             end if end proc
 > $\mathrm{t2}≔\mathrm{Build}\left(\mathrm{procs}=a,\mathrm{commands}='a\left(0\right)',\mathrm{commands}=\left['a\left(2\right)','a\left(-1\right)'\right]\right)$
 ${\mathrm{t2}}{≔}{\mathrm{table}}\left(\left[{\mathrm{_Inert_ASSIGNEDNAME}}{}\left({"a"}{,}{"PROC"}\right){=}\left[\begin{array}{rrr}{3}& {0}& {9}\\ {3}& {0}& {9}\\ {1}& {0}& {0}\\ {2}& {0}& {0}\end{array}\right]\right]\right)$ (2)
 > $\mathrm{PrintProfiles}\left(\mathrm{t2}\right)$
 a a := proc(x)      |Calls Seconds  Words| PROC |    3   0.000      9|    1 |    3   0.000      9| if 1 < x then    2 |    1   0.000      0|   return 1                             else    3 |    2   0.000      0|   return 0                             end if end proc
 > $t≔\mathrm{Merge}\left(\mathrm{t1},\mathrm{t2}\right)$
 ${t}{≔}{\mathrm{table}}\left(\left[{\mathrm{_Inert_ASSIGNEDNAME}}{}\left({"a"}{,}{"PROC"}\right){=}\left[\begin{array}{rrr}{5}& {0}& {15}\\ {5}& {0}& {15}\\ {2}& {0}& {0}\\ {3}& {0}& {0}\end{array}\right]\right]\right)$ (3)
 > $\mathrm{PrintProfiles}\left(t\right)$
 a a := proc(x)      |Calls Seconds  Words| PROC |    5   0.000     15|    1 |    5   0.000     15| if 1 < x then    2 |    2   0.000      0|   return 1                             else    3 |    3   0.000      0|   return 0                             end if end proc