Re: [sage-devel] Unreasonably slow piecewise function

2024-05-02 Thread Michael Orlitzky
On Thu, 2024-05-02 at 02:13 -0700, Kwankyu Lee wrote: > Moreover, this case seems to spur the need to introduce timing tests to > watch out regressions in code performance without a failure. > Shameless plug: https://github.com/sagemath/sage/pull/36226 I see these regressions (old

Re: [sage-devel] Unreasonably slow piecewise function

2024-05-02 Thread Kwankyu Lee
Moreover, this case seems to spur the need to introduce timing tests to watch out regressions in code performance without a failure. -- 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

Re: [sage-devel] Unreasonably slow piecewise function

2024-05-02 Thread Kwankyu Lee
On Thursday, May 2, 2024 at 8:54:58 AM UTC+9 Nils Bruin wrote: ... I'd expect that performance can be significantly improved by optimizing the sage code. Exactly. It is related with sage: time bool(x == 0.1) CPU times: user 1.47 s, sys: 133 ms, total: 1.6 s Wall time: 1.14 s False Fixed

Re: [sage-devel] Unreasonably slow piecewise function

2024-05-01 Thread Nils Bruin
On Wednesday 1 May 2024 at 16:45:36 UTC-7 Kwankyu Lee wrote: I wonder if they, maintainers of maxima, would regard this as a bug... I'm pretty sure the piecewise functions are NOT borrowed from maxima. It probably gets called because there are some inequalities concerning the symbolic ring.

Re: [sage-devel] Unreasonably slow piecewise function

2024-05-01 Thread Kwankyu Lee
On Thursday, May 2, 2024 at 12:37:44 AM UTC+9 Nils Bruin wrote: Working on *why* it might be so slow a bit: %prun for i in range(100r): f(0.1) 798103 function calls (791903 primitive calls) in 1.327 seconds Impressive. Thanks. so, most stuff is happening in maxima and in _subs_,

Re: [sage-devel] Unreasonably slow piecewise function

2024-05-01 Thread Nils Bruin
Working on *why* it might be so slow a bit: %prun for i in range(100r): f(0.1) 798103 function calls (791903 primitive calls) in 1.327 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 80000.5560.0000.628

Re: [sage-devel] Unreasonably slow piecewise function

2024-05-01 Thread David Joyner
For another data point, on an ubuntu laptop: sage: time [f(0.1*i) for i in range(1,10)] CPU times: user 136 ms, sys: 0 ns, total: 136 ms Wall time: 99.1 ms [1, 1, 1, 1, 1, 1, 1, 1, 1] sage: time f(0.1) CPU times: user 13.6 ms, sys: 0 ns, total: 13.6 ms Wall time: 13.5 ms 1 sage: version()

[sage-devel] Unreasonably slow piecewise function

2024-05-01 Thread Kwankyu Lee
Hi, I get sage: f = piecewise([((0,1),1)]) sage: time f(0.1) CPU times: user 135 ms, sys: 4.23 ms, total: 140 ms Wall time: 146 ms 1 sage: time f(0.2) CPU times: user 133 ms, sys: 3.56 ms, total: 136 ms Wall time: 137 ms 1 This is painfully slow. Is this normal? -- You received this message