Bug introduced in 10.0 and fixed in 10.1.0

I am having a severe slowdown problem with Mathematica 10 new Testing Notebook feature (File -> New -> Testing Notebook).

Please try this simple test:

fast test

Now introduce some newlines and try again:

enter image description here

The second test is much slower. Now the real problem is that the slowdown increases very very fast if you add more elements to the test. These are my results:

 1 ->   0.4 sec
 2 ->   0.4 sec
 3 ->   0.4 sec
 4 ->   0.4 sec
 5 ->   0.4 sec
 6 ->   0.4 sec
 7 ->   0.8 sec
 8 ->   3.7 sec (shown above)
 9 ->  22   sec
10 -> 190   sec
11 -> I don’t want to try

For long commands, the tests are much more readable by introducing some line breaks. This is why this problem matters to me.

Can you reproduce this? I am using Mathematica 10.0.2 and Windows 7.

  • $\begingroup$ Reproduced in V10, Windows. Just a bug. $\endgroup$ Feb 6, 2015 at 18:28
  • $\begingroup$ I still experience unnatural slowdowns with large testing notebooks. Is that by design? $\endgroup$
    – masterxilo
    Aug 25, 2016 at 20:46

2 Answers 2


This seems to be a bug in .../SystemFiles/Components/MUnit/Kernel/Notebooks.m, probably somewhere in testOptionPatterns or whiteSpaceOrNone or somewhere there. Of course it is nearly impossible to efficiently parse any longer NotebookRead box structure with the Kernel pattern matcher, so I would always run test files from .mt files in Workbench, or, if you really need to use the FrontEnd for, o.k., maybe developing test files, then I would just create a simple button like

CreatePalette@Button["ToInputForm",((NotebookFind[SelectedNotebook[], #1, All, CellStyle]; 
       "SelectionConvert", "InputForm"]}]) & ) /@ 
  {"VerificationTest", "ExpectedOutput"}]

Then select your test notebook with the newlines, then click on the "ToInputForm" button and all "VerificationTest" and "ExpectedOutput" test cells are converted to InputForm and things seem to work fine.

  • $\begingroup$ Thank you Rolf. I'll explore moving into Workbench (at least the test part). $\endgroup$ Feb 7, 2015 at 15:20

This issue has been fixed in 10.1+

  • 1
    $\begingroup$ Please provide a bit more detail, such as the source of your information. $\endgroup$
    – bbgodfrey
    Jul 15, 2015 at 17:49
  • $\begingroup$ With 10.1 under Windows 8.1 (64bit), I can confirm that this problem does not occur. $\endgroup$
    – bbgodfrey
    Jul 15, 2015 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.