Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.4K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Evaluating Piecewise function defined inside Do loop is very slow

POSTED BY: Patrick Bourg

Without checking your code:

The most time consuming constructs in an interpreting language are high level Do-loops and nested logical branchings by unstructrured Ifs.

Replace Do constructs by Mapping functions into arays.

Replace Piecewise and Which constructs by conditonal definitions where possible. If prcecison is not an issue, Replace slow evaluating functions by an Interpolation.

Try to avoid any overhead by logical tests, if they are not unavoidable in the current run.

POSTED BY: Roland Franzius
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard