Optimize your algorithm

Sometimes, inefficient custom algorithms can lead to system performance issues.

You can prevent these performance issues by optimizing your algorithm.

Conditions

You can optimize conditions within your algorithm by:

  • Using conditions sparingly

  • Placing conditions as early in your algorithm as possible

maple("...") function

Sending Maple™ code to the Möbius math engine (MapleNet™) allows you to create unique algorithms.

However, note that:

  • Computations that take a long time to execute will affect the response time experienced by your students; execution time is capped at 20 seconds.

  • Each individual maple("...") call takes up its own MapleNet™ thread, and hence introduces some overhead.

You can then optimize the usage of the maple("...") function within your algorithm by:

  • Using the maple("...") function sparingly;

  • Combining multiple lines of Maple code and multiple calculations within the same maple("...") function; and

  • Outputting multiple results from one maple("...") function and separating them by commas.