2
$\begingroup$

I have installed the latest version 11.3 in a dual boot laptop with Windows 7 and Ubuntu 16.04. The laptop has a quad core i7 CPU capable of reaching 3.9 GHz (with turbo boost).

In both operating systems I have noticed the following: when I open Mathematica the very first execution takes a while to complete. For example, even the trivial 2 + 2 needs about 2 seconds for giving the answer. Then, if I repeat the calculation, or try another one the speed is normal (2 + 2 instantly).

So, why there is such a hesitation during the very first calculation? has anyone else experienced a similar situation? If so, is, there a way to fix that?

$\endgroup$
  • 4
    $\begingroup$ The "hesitation" is the MathKernel being started. There is no way to avoid that. $\endgroup$ – Henrik Schumacher Jun 23 '18 at 15:37
  • $\begingroup$ @HenrikSchumacher But why in previous versions of Mathematica there was no such hesitation? $\endgroup$ – Vaggelis_Z Jun 23 '18 at 15:40
  • 2
    $\begingroup$ It has always been there. But as more an more definitions are made in the ``System``` context with every new version (instead of being put into specialized packages), more and more definitions have to be loaded when the kernel starts. So it may be that the load time is longer in newer versions than in older ones. $\endgroup$ – Henrik Schumacher Jun 23 '18 at 15:53
4
$\begingroup$

(Turning a comment into an answer.)

The "hesitation" is the MathKernel being started. As far as I know, there is no way to avoid that.

This loading time has already been there for earlier versions. But as more and more definitions are added to the System` context with every new version (instead of being put into specialized packages), more and more definitions have to be loaded when the kernel starts. So it may be that the loading time is longer in newer versions than in older ones.

$\endgroup$
  • $\begingroup$ I just did the following experiment: I installed version 11.0.1 in the same laptop. In version 11.0.1 the output of the first calculation of 2 + 2 is derived instantly. However in version 11.3 we have to wait for about 2 seconds. I do not believe that version 11.3 has so much more definitions added to the System. I could be wrong though... $\endgroup$ – Vaggelis_Z Jun 23 '18 at 17:00
  • $\begingroup$ I happen to have version 11.0.1 and version 11.3, both for macOS . I can confirm that the older version can do "the first addition" a bit faster. The older version has 5898 and the new version has 6268 symbols in the "System`" context. But that's a poor indicator as several of these symbols will also be backed by libraries that also have to be loaded - and others are not. $\endgroup$ – Henrik Schumacher Jun 23 '18 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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