Re: [sage-devel] Python 3 startup time speedup
On Mon, Dec 17, 2018 at 4:52 PM William Stein wrote: > > On Mon, Dec 17, 2018 at 7:01 AM E. Madison Bray wrote: > > > > Hi all, > > > > For those of you interested in following the Python 3 port of Sage, > > you'll be amused to learn that an effectively one line change [1] made > > startup time of Sage on Python 3 about 20 times faster, and almost as > > fast as on Python 2 (though still about 30% slower--need to see if > > there are any other slowdowns we can root out). > > > > The effect seems to be less pronounced on Python 2 for some reason, > > but it still improves startup time by about half a second. > > > > [1] > > https://git.sagemath.org/sage.git/commit?id=384311405318315449c7cc0835db33f3b816b283 > > Wow, great work! > > The relevant code that is slowing startup down so much is the > *function/method deprecation decorator*. > I wonder if we have a ton of code that is marked as deprecated, but > not removed? Otherwise, wouldn't > this code you fixed have less of an effect? I think the > deprecation period is typically 1 year. I wonder what > percentage of deprecated code is older than a year... (and hence could > be removed). We definitely don't check regularly enough for deprecated interfaces that can be removed. I think it should be done before each release. However, normally the code for deprecating functions should not cause any significant slowdown. It just so happens this code was using a needlessly large, slow function call just to look one Python stack frame up from the current one (in fact, this could just use `sys._getframe()` which despite the underscore is well-supported due to how frequently it's abused). -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Python 3 startup time speedup
On Mon, Dec 17, 2018 at 7:01 AM E. Madison Bray wrote: > > Hi all, > > For those of you interested in following the Python 3 port of Sage, > you'll be amused to learn that an effectively one line change [1] made > startup time of Sage on Python 3 about 20 times faster, and almost as > fast as on Python 2 (though still about 30% slower--need to see if > there are any other slowdowns we can root out). > > The effect seems to be less pronounced on Python 2 for some reason, > but it still improves startup time by about half a second. > > [1] > https://git.sagemath.org/sage.git/commit?id=384311405318315449c7cc0835db33f3b816b283 Wow, great work! The relevant code that is slowing startup down so much is the *function/method deprecation decorator*. I wonder if we have a ton of code that is marked as deprecated, but not removed? Otherwise, wouldn't this code you fixed have less of an effect? I think the deprecation period is typically 1 year. I wonder what percentage of deprecated code is older than a year... (and hence could be removed). -- William > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- William (http://wstein.org) -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Python 3 startup time speedup
Hi all, For those of you interested in following the Python 3 port of Sage, you'll be amused to learn that an effectively one line change [1] made startup time of Sage on Python 3 about 20 times faster, and almost as fast as on Python 2 (though still about 30% slower--need to see if there are any other slowdowns we can root out). The effect seems to be less pronounced on Python 2 for some reason, but it still improves startup time by about half a second. [1] https://git.sagemath.org/sage.git/commit?id=384311405318315449c7cc0835db33f3b816b283 -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.