Re: Profiler for Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg36539] Re: Profiler for Mathematica
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 11 Sep 2002 03:28:06 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <aleu5l$572$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, a Mathematica profiler is described in The Mathematica Journal Volume 5, Issue 3, Summer 1995 The Mathematica Toolbox: A Mathematica Profiler by Todd Gayley The electronic material for this issue isn not on MathSource but it may be that Todd has the code some where and can make is acessible. Regards Jens Husain Ali Al-Mohssen wrote: > > Hi All, > > I have been trying to code Sethian's Fast Marching Method in 2D but Mathematica > has been very slow (taking something like 1-2 hours for something that > should take much less than a second in C++). I am sure part of the problem > lies in the way I wrote the code but I don't know what is spending most of > my time. > > I looked at the list archives and there was mention of an profiling > package for Mathematica but a)I can't find it & b)It may not work with Mathematica 4.*. > My questions: > 1. Any general suggestions on how to figure out which functions are taking > most of the time? I guess I could manually have each function I am > interested in monitoring keep a variable that counts the amount of CPU > time that has been spent on it by doing something like: > function[args_]:=Module[{},functionTimer+=Timing[ .... My actual function > ..... ][[1]]] > but it would very cumbersome to do this to all of the functions in my > program and I am not sure I will get accurate results anyway. > 2. Compiling functions is not always that easy. I did read the on-line > docs and the archives and it does take some work to make a function > compile usefully. Is there an FAQ or a tutorial somewhere? > 3. Am I the only one who finds the lack of a profiler really really > annoying ? Mathematica is powerful and it is usually easy to ask it to do what u > want. The challenge a lot of times is doing so without taking too long. > > Thanks, > Husain > PS: One more quick one: Why does the front end act funny when I have the > num lock turned on on Linux? (Linux,Athlon, KDE)