0

Upon opening a .wl file someone send me I noticed that about 20 seconds were spend parsing the file. Sometimes it spends less time doing so for much bigger files. Upon looking up the term "parsing" in the documentation center I found no information about the parsing process of files by Mathematica so therefore:

Questions:

  1. What does Mathematica do when it parses a file and what affects parsing time, and related:
  2. Is parsing something I have to care about when writing packages?
Gert
  • 1,530
  • 8
  • 22
  • 2
    That depends very much on what is written in the file. For example, Mathematica loads a lot of of stuff when Graphics-related code is executed for the first time in a session. – Henrik Schumacher Dec 17 '21 at 13:40
  • 1
    Loading of a package also takes quite long if the package makes a lot use of Compile. There are ways to enforce one-time compilation (so that the created libraries still persist after the session is closed), but, to my knowledge, there is no easy, automated way to deploy such things. – Henrik Schumacher Dec 17 '21 at 17:04

0 Answers0