Re: [sage-devel] Re: Significant slowdown of basic arithmetic

2019-11-24 Thread TB
On 24/11/2019 20:04, Marc Mezzarobba wrote: Marc Mezzarobba wrote: sage: def f(): : for i in [x]range(1): : a+a where a = Integer(1). If a is made local to the function, the very expensive lookups disappear, and we still see calls to PyLong_FromLong taking much lon

[sage-devel] Re: Significant slowdown of basic arithmetic

2019-11-24 Thread Marc Mezzarobba
Marc Mezzarobba wrote: >> sage: def f(): >> : for i in [x]range(1): >> : a+a > > where a = Integer(1). > > If a is made local to the function, the very expensive lookups > disappear, and we still see calls to PyLong_FromLong taking much > longer than PyInt_FromLong, as

[sage-devel] Re: Significant slowdown of basic arithmetic

2019-11-24 Thread Marc Mezzarobba
Marc Mezzarobba wrote: > Some profiling data (via linux-perf) for > > sage: def f(): > : for i in [x]range(1): > : a+a where a = Integer(1). If a is made local to the function, the very expensive lookups disappear, and we still see calls to PyLong_FromLong taking mu