Message Boards Message Boards

Bottlenecking Code

GROUPS:
Hey guys,

So I'm working with a pretty large block of code and the thing is moving way slower than it should be in theory. Is there a way that I can monitor exactly where in the code Mathematica is working at any given moment?

Thanks bros!
POSTED BY: Jake Smith
Answer
4 years ago
While this will not tell you exactly where in the code Mathematica is working at any given moment, this
LinkWrite[$ParentLink,
SetNotebookStatusLine[FrontEnd`EvaluationNotebook[], "Beginning to evaluate xxx"]];
can be placed at appropriate places in your code and it will display the string in the lower left corner of the notebook "status line."
You can even enhance that by using ToString in conjunction with StrinJoin to splice in the values of expressions if that will help.
Putting one of those before each potentially time consuming block of code can help you diagnose where things are slowing down.
POSTED BY: Bill Simpson
Answer
4 years ago
In Evaluation > Debugger mode, you can use  RuntimeTools`Profile[ (* your code here *)]  to get how much time is spent on each statement.  Not exactly what you asked for, but assuming your command finishes, it might be helpful nonetheless.
POSTED BY: Michael Rogers
Answer
4 years ago

Group Abstract Group Abstract