Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cython() slow on Cygwin #31187

Closed
embray opened this issue Jan 5, 2021 · 7 comments
Closed

cython() slow on Cygwin #31187

embray opened this issue Jan 5, 2021 · 7 comments

Comments

@embray
Copy link
Contributor

embray commented Jan 5, 2021

At least on the latest release build I did, running the cython() function is extremely slow, even for compiling a trivial function, taking up to a minute on my system.

sage: %timeit cython('def foo(): pass')
48.3 s ± 497 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

While I recall it being slower on Cygwin than on Linux (almost anything that involves running a subprocess is) I don't recall it ever being this slow.

Depends on #31344

Component: porting: Cygwin

Keywords: cygwin cython

Issue created by migration from https://trac.sagemath.org/ticket/31187

@embray embray added this to the sage-9.3 milestone Jan 5, 2021
@embray
Copy link
Contributor Author

embray commented Jan 5, 2021

comment:1

One observation is that every time I call cython() the CPU usage of "Windows Defender Antivirus Service" spikes.

@embray
Copy link
Contributor Author

embray commented Jan 5, 2021

comment:2

It seems to be sage.env.cython_aliases that's responsible for this, as it makes many pkgconfig calls each time using a subprocess, and is called every time cythonize() is called. ISTM it should be possible to cache the results of this call; maybe even run it in the background after Sage starts.

@embray
Copy link
Contributor Author

embray commented Jan 5, 2021

comment:3

For reference this is definitely responsible for the majority of this overhead:

sage: %timeit sage.env.cython_aliases()
48.6 s ± 1.97 s per loop (mean ± std. dev. of 7 runs, 1 loop each)

@embray
Copy link
Contributor Author

embray commented Jan 5, 2021

comment:4

Another idea would be to run this as a post-install step it is already run when building Sage, so if its results can be cached and included in the Sage installation that would solve the problem.

@mkoeppe
Copy link
Member

mkoeppe commented Feb 13, 2021

Dependencies: #31344

@mkoeppe
Copy link
Member

mkoeppe commented Feb 13, 2021

comment:5

#31344 caches the results of sage.env.cython_aliases; more work is taking place in #31365, #31384

@mkoeppe
Copy link
Member

mkoeppe commented Mar 24, 2021

comment:6

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 24, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 14, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Mar 5, 2022
@mkoeppe mkoeppe removed this from the sage-9.7 milestone Aug 25, 2022
@mkoeppe mkoeppe closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants