1
$\begingroup$

I have a user-written package (600kB), which I load the standard way:

<<MyPack.m

or

Get["MyPack.m"]

When I am connected to the internet, this takes 18 seconds to load; while when I shut down the internet connection at the computer system level, the same executes in 4.5 seconds.

None of

CurrentValue[\$FrontEndSession, "AllowDownloads"] = False;

CurrentValue[\$FrontEnd, "AllowDownloads"] = False;

\$AllowInternet = False;

change this behavior.

Has anyone a suggestion?

(MacOS 10.15.6, Mathematica 13.2)

Thanks!

UPDATE: Using the suggested print statements, I was able to locate the problem: It is the calls to "Compile" which execute much slower when connected to a network.

$\endgroup$
4
  • $\begingroup$ What are you doing inside your package? Is there anything that might try to load data from somewhere, e.g. some Entity queries or similar? Or is there some unavailable network location on your $Path that Mathematica tries to search for your package? $\endgroup$
    – Lukas Lang
    Commented Apr 13, 2023 at 18:45
  • 3
    $\begingroup$ Can Print statements help narrow down which line of code is causing the slowdown? $\endgroup$
    – Jason B.
    Commented Apr 13, 2023 at 18:45
  • $\begingroup$ Are you using a fresh kernel each time or is it only loading the package without system initialization taken into account? $\endgroup$
    – Kuba
    Commented Apr 14, 2023 at 6:26
  • $\begingroup$ Thanks so far! - $Path contains only local files - Print statements are a good idea! - No, typically I do not actively restart the Kernel when re-loading. $\endgroup$ Commented Apr 14, 2023 at 14:27

0

Browse other questions tagged or ask your own question.