M2 icon indicating copy to clipboard operation
M2 copied to clipboard

slow startup time in 1.25.06?

Open mikestillman opened this issue 5 months ago • 7 comments

This might just be because the documentation hasn't all been built yet, but even so, that seems pretty slow.

development, on a Mac M4, while ninja is still being run to build M2

bash-3.2$ time ./M2 -e "exit 0"
Macaulay2, version 1.25.06-49-g00070ebdbc-dirty (development)
Type "help" to see useful commands

real	0m2.137s
user	0m1.861s
sys	0m1.162s

edit: here is the time in the build tree, after all examples and doc have been built:

bash-3.2$ time ./M2 -e "exit 0"
Macaulay2, version 1.25.06-49-g00070ebdbc-dirty (development)
Type "help" to see useful commands

real	0m1.217s
user	0m0.622s
sys	0m0.395s

homebrew version, same machine (same ninja being run in background too)

bash-3.2$ time M2 -e "exit 0"
Macaulay2, version 1.25.05
Type "help" to see useful commands

real	0m0.652s
user	0m0.463s
sys	0m0.205s

mikestillman avatar Jun 03 '25 14:06 mikestillman

I'll add in the timing, once the build has fiinished too.

mikestillman avatar Jun 03 '25 14:06 mikestillman

The time to run each example (that is not captured) is quite large. I will edit this and leave some timings soon.

edit: While building under cmake, I get e.g. the following times, which seem much larger than they should be?

[372/634] Installing package LexIdeals
 -- making example results for "hilbertFunct"                                -- 10.9612s elapsed
 -- making example results for "isLexIdeal"                                  -- 11.9908s elapsed
 -- making example results for "isLPP"                                       -- 11.6621s elapsed
 -- making example results for "isPurePower"                                 -- 10.7148s elapsed
 -- making example results for "macaulayLowerOperator"                       -- 10.9433s elapsed
 -- making example results for "multBounds"                                  -- 10.6707s elapsed
 -- making example results for "cancelAll"                                   -- 10.5646s elapsed
 -- making example results for "isHF"                                        -- 10.7203s elapsed
 -- making example results for "multUpperBound"                              -- 10.3878s elapsed
 -- making example results for "LPP"                                         -- 10.5913s elapsed
 -- making example results for "multLowerBound"                              -- 10.0005s elapsed
 -- making example results for "multUpperHF"                                 -- 10.6749s elapsed
 -- making example results for "isCM"                                        -- 11.2941s elapsed
 -- making example results for "lexIdeal"                                    -- 10.8775s elapsed
 -- making example results for "macaulayRep"                                 -- 11.3446s elapsed
 -- making example results for "generateLPPs"                                -- 11.1158s elapsed
 -- making example results for "macaulayBound"                               -- 9.5606s elapsed

mikestillman avatar Jun 03 '25 14:06 mikestillman

I wonder if this is related to the cmake macOS GitHub builds that have been taking a long time/occasionally timing out

d-torrance avatar Jun 03 '25 14:06 d-torrance

Try starting with --no-core -e "exit 0".

mahrud avatar Jun 03 '25 16:06 mahrud

I tested a build which was closer to a month ago (engine-parallel-fix, before it got merged in), some timings (note, almost all timings for all of the examples seemed to have similar difference). I'm not quite sure when I rebased this branch on top of development before that, but I can look, and also I can try to zero in on when the slowdown got introduced.

[626/626] Installing package MultiprojectiveVarieties
 -- making example results for "ring(MultiprojectiveVariety)"                -- 2.28572s elapsed
 -- making example results for "inverse2"                                    -- 4.36809s elapsed
 -- making example results for "isIsomorphism(MultirationalMap)"             -- 3.8285s elapsed

and in development now (same machine, compilers, etc, I think):

[633/634] Installing package MultiprojectiveVarieties
 -- making example results for "ring(MultiprojectiveVariety)"                -- 8.60943s elapsed
 -- making example results for "inverse2"                                    -- 10.9546s elapsed
 -- making example results for "isIsomorphism(MultirationalMap)"             -- 15.6676s elapsed

mikestillman avatar Jun 03 '25 17:06 mikestillman

A while ago I noticed this and tracked it down to between https://github.com/Macaulay2/M2/actions/runs/15089447491/job/42416084439 and https://github.com/Macaulay2/M2/actions/runs/15090993781/job/42419486178

mahrud avatar Jun 03 '25 18:06 mahrud

@mikestillman if you could bisect to find which commit caused this it would be great.

mahrud avatar Jun 13 '25 01:06 mahrud

@mikestillman -- are things back to normal now? This should have been fixed by #3912.

d-torrance avatar Jul 19 '25 16:07 d-torrance