Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
CodeTools[Profiling][SortBy] - analyze and display profiling data
Calling Sequence
SortBy(proc1, proc2, ..., tab1, tab2, ..., opts)
Parameters
proc1, proc2, ...
-
(optional) procedure
tab1, tab2, ...
(optional) table
opts
(optional) equation(s) of the form option=value where option is one of 'number', 'order', or 'statements'; specify options for the SortBy command
Description
The SortBy() command analyzes the profiling data for all the procedures for which data is available and prints the results.
The SortBy(proc1, proc2, ...) command analyzes the profiling data for the specified procedures and prints the results.
The SortBy(proc1, proc2, ..., tab1, tab2, ...) command analyzes the profiling data for the specified procedures and tables and prints the results.
The opts parameter can contain any of the following equations that specify options for the SortBy command.
'number' = nonnegative integer
Specifies the number of items displayed. The number option can be used to control the maximum number of items displayed. If , the top n elements are selected after the items have been sorted.
'order' = value
Specifies how to sort the table. If order is not specified, then the default is rload.
The optional argument order can be any one of the following:
alpha - sort table alphabetically by function name
ralpha - sort table reverse alphabetically by function name
time - sort table by increasing cpu time usage
rtime - sort table by decreasing cpu time usage
words - sort table by increasing memory usage
rwords - sort table by decreasing memory usage
calls - sort table by increasing number of calls to each function
rcalls - sort table by decreasing number of calls to each function
load - sort table by increasing memory^2*time
rload - sort table by decreasing memory^2*time
'statements' = true or false
Specifies whether to analyze procedures or statements. If statements=true is specified, then the SortBy function analyzes the statements instead of procedures. All the statements of the procedures are considered.
When displaying statements, the procedure name, statement number, and an abbreviation of the statement are provided with the profiling information.
It is possible that the total number of words used or the total time taken is zero. In this case, the percent times and percent words are always zero, and the total percent time and the total percent words is 100%. If either of these events occur, SortBy prints a warning message.
Examples
a := proc( ) local i; for i to 25 do int( sin(exp(x^i)), x ); end do; end proc:
b := proc( ) local i; for i to 30 do int( tan(exp(x^i)), x ); end do; end proc:
c := proc( ) a(); b(); end proc:
function calls time time% words words% --------------------------------------------------------------------------- c 1 0.000 0.00 12 0.00 b 1 0.842 50.21 4041338 47.71 a 1 0.835 49.79 4429516 52.29 --------------------------------------------------------------------------- total: 3 1.677 100.00 8470866 100.00
function calls time time% words words% --------------------------------------------------------------------------- b 1 0.842 50.21 4041338 47.71 a 1 0.835 49.79 4429516 52.29 c 1 0.000 0.00 12 0.00 --------------------------------------------------------------------------- total: 3 1.677 100.00 8470866 100.00
function calls time time% words words% --------------------------------------------------------------------------- a 1 0.835 49.79 4429516 52.29 b 1 0.842 50.21 4041338 47.71 c 1 0.000 0.00 12 0.00 --------------------------------------------------------------------------- total: 3 1.677 100.00 8470866 100.00
function calls time time% words words% --------------------------------------------------------------------------- a 25 0.835 49.79 4429516 52.29 stat 2) 2 int(sin(exp(x^i)),x) b 30 0.842 50.21 4041338 47.71 stat 2) 2 int(tan(exp(x^i)),x) c 1 0.000 0.00 6 0.00 stat 2) 2 b() b 1 0.000 0.00 0 0.00 stat 1) 1 for i to 30 do a 1 0.000 0.00 0 0.00 stat 1) 1 for i to 25 do c 1 0.000 0.00 6 0.00 stat 1) 1 a(); --------------------------------------------------------------------------- total: 59 1.677 100.00 8470866 100.00
function calls time time% words words% --------------------------------------------------------------------------- a 25 0.835 49.79 4429516 52.29 stat 2) 2 int(sin(exp(x^i)),x) b 30 0.842 50.21 4041338 47.71 stat 2) 2 int(tan(exp(x^i)),x) c 1 0.000 0.00 6 0.00 stat 2) 2 b() --------------------------------------------------------------------------- total: 59 1.677 100.00 8470860 100.00
See Also
CodeTools[Profiling], CodeTools[Profiling][Build], CodeTools[Profiling][GetProfileTable], CodeTools[Profiling][Merge], CodeTools[Profiling][PrintProfiles], CodeTools[Profiling][Profile]
Download Help Document