Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
The profile Function
Calling Sequence
profile(procedure1, procedure2, ...)
Parameters
procedure1, procedure2, ...
-
any number of valid Maple procedures that have not already been profiled with profile
Description
The procedure profile alters the given procedures to record runtime information on the procedures. If profile is successful, it returns NULL on exit.
The profiling information is printed using the showprofile() function as shown in the examples below. For more options and examples see ?showprofile. To stop collecting profiling information on a function, use unprofile(). To reset the profiler to begin a new profile use resetprofile().
Use of profile() increases memory usage and slows down computations, sometimes dramatically. In addition, profile may not work properly with procedures that have special evaluation rules.
A closely related function, exprofile(), can be used to profile all Maple functions at once.
Examples
fib:=proc(n) option remember; if n<2 then n else fib(n-1)+fib(n-2) end if; end proc:
function depth calls time time% bytes bytes% --------------------------------------------------------------------------- fib 5 9 0.000 0.00 6168 100.00 --------------------------------------------------------------------------- total: 5 9 0.000 0.00 6168 100.00
function depth calls time time% bytes bytes% --------------------------------------------------------------------------- gcd 1 1 0.011 91.67 552280 84.89 randpoly 1 3 0.001 8.33 74504 11.45 expand 1 8 0.000 0.00 6160 0.95 divide 1 6 0.000 0.00 17656 2.71 --------------------------------------------------------------------------- total: 4 18 0.012 100.00 650600 100.00
function depth calls time time% bytes bytes% --------------------------------------------------------------------------- gcd 1 1 0.005 71.43 253256 69.59 divide 1 6 0.002 28.57 110656 30.41 content 0 0 0.000 0.00 0 0.00 --------------------------------------------------------------------------- total: 2 7 0.007 100.00 363912 100.00
See Also
exprofile, kernelopts, showprofile, unprofile
Download Help Document