Message Boards Message Boards

0
|
16390 Views
|
2 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Bottlenecking Code

Posted 11 years ago
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
2 Replies
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
Posted 11 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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract