Mathematica is getting slow when repeatedly starting an external program

70 views Asked by At

I found a strange phenomenon that Mathematica is getting slow when I repeatedly started an external program by using ReadList. For example, the following code will display a significant increase of CPU time for each 'ls' command (my platform is OS X):

data = Table[Timing[ReadList["!ls"]], {100000}][[All, 1]];
ListPlot[data]

This phenomenon seems ubiquitous for the other external programs. Can anyone suggest me how to avoid this speed down?

0

There are 0 answers