Macaulay2 / Macaulay2/M2

Speeding up running Macaulay2Doc examples

Open
#1,480 5 comments 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #1546 by @mahrud — merged
Documentation
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

Once #1469 is fixed and #1454 is merged, we can run examples from Macaulay2Doc in the same process. This would cut at least 35 minutes from the install time (there are 1185 documentation keys, each starting a new M2 process which takes at least 1.8s on my relatively fast machine).

However, even after that some of the tests seem to take a lot longer, and it would be good to reduce them. For instance, here is the line that contributes to the fifth longest example from the node `"communicating with programs"`, which takes about 8s:
https://github.com/Macaulay2/M2/blob/65332ed07101a51255182fb5a16e4e6e20809292/M2/Macaulay2/packages/Macaulay2Doc/overview2.m2#L826

Here is the top percentile of examples by running time:
```m2
16.5518 seconds elapsed -- isPseudoprime(ZZ)
10.88 seconds elapsed -- minimalBetti(Ideal)
9.45877 seconds elapsed -- FastNonminimal
8.25365 seconds elapsed -- benchmark
8.0775 seconds elapsed -- communicating with programs
6.79511 seconds elapsed -- computing resolutions
6.21707 seconds elapsed -- betti(..., Minimize => ...)
4.50856 seconds elapsed -- quotient(..., Strategy => ...)
4.07333 seconds elapsed -- variety(Ring)
3.90818 seconds elapsed -- cancelTask(Task)
3.83857 seconds elapsed -- parallel programming with threads and tasks
3.65652 seconds elapsed -- Tutorial: Divisors
3.51705 seconds elapsed -- HH^ZZ CoherentSheaf
3.17934 seconds elapsed -- randomKRationalPoint
3.1685 seconds elapsed -- computing Groebner bases
3.09443 seconds elapsed -- elimination of variables
3.03655 seconds elapsed -- Tutorial: Fano varieties
```

PS: parallelization with `capture` is probably going to take a lot more work, since the task supervisor needs fixes before it can handle IO access in parallel. That's not the topic of this issue, however. See #1689 and #992 instead.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Macaulay2Doc example runner and the example at M2/Macaulay2/packages/Macaulay2Doc/overview2.m2:826, then review the listed slow examples and the related issues #1469 and #1454. Done means the examples still run correctly while the documented process overhead and the slowest example runtimes are reduced.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.