Opened 10 years ago
Last modified 20 months ago
#5930 closed enhancement
switch from maxima to pynac for core symbolic manipulation system — at Version 5
Reported by: | was | Owned by: | tbd |
---|---|---|---|
Priority: | blocker | Milestone: | sage-4.0 |
Component: | symbolics | Keywords: | |
Cc: | burcin | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
SEE http://wiki.sagemath.org/symbolics/pynac_todo/push
If you want to try the code out do this:
- Install sage-3.4.2.
- Build pynac (should take about 3-5 minutes):
./sage -i http://sage.math.washington.edu/home/mhansen/symbolics/pynac-0.1.6-mh.spkg
- Apply the two patches at http://sage.math.washington.edu/home/mhansen/symbolics/
sage: hg_sage.apply('http://sage.math.washington.edu/home/mhansen/symbolics/symbolics_1.patch') sage: hg_sage.apply('http://sage.math.washington.edu/home/mhansen/symbolics/symbolics_2.patch')
Just check in each with some random comment.
- Delete all traces of constants.so:
rm devel/sage/build/*/sage/symbolic/constants* rm devel/sage/build/sage/symbolic/constants.so
- Build with "sage -br", and it should work. Building will take a while, since the patches touch many files.
Change History (5)
comment:1 Changed 10 years ago by
- Cc burcin added
- Component changed from algebra to symbolics
comment:2 Changed 10 years ago by
- Description modified (diff)
comment:3 Changed 10 years ago by
- Description modified (diff)
comment:4 Changed 10 years ago by
There is a sequence of *serious* speed regressions that I think Burcin caused by changes to the pynac spkg:
IN SAGE-3.2 we get OK timings for this benchmarks. They aren't great, but I can live with them, since it is"only" 57 times slower than Singular:
sage: var('x,y,z', ns=1); f = (x+y+z)^6; sage: timeit('(f*(f+1)).expand()') 125 loops, best of 3: 3.25 ms per loop
In Singular:
sage: R.<x,y,z> = QQ[] sage: timeit('g=(x+y+z)^6*((x+y+z)^6+1)') 625 loops, best of 3: 56.3 µs per loop sage: 3250/56.3 57.7264653641208
It's hard to tell, but Mathematica seems to take about 1.7ms, which is comparable to the above:
sage: timeit("s=mathematica('Expand[(x+y+z)^6*((x+y+z)^6+1)]')") 125 loops, best of 3: 1.81 ms per loop sage: timeit("s=mathematica('2+3')") 625 loops, best of 3: 125 µs per loop
Maxima via Sage takes about 61 ms, since I guess (c)lisp is slow, etc.:
sage: timeit("s=maxima('expand((x+y+z)^6*((x+y+z)^6+1))')") 5 loops, best of 3: 61.8 ms per loop
First there was a MAJOR unacceptable speed regression going to sage-3.3 (this is probably all caused by the pynac spkg). The timing jumped all the way to 42ms, so now it's almost as bad as Maxima:
sage: var('x,y,z', ns=1); f = (x+y+z)^6 (x, y, z) sage: timeit('(f*(f+1)).expand()') 5 loops, best of 3: 42.1 ms per loop
In fact, directly in sage-3.2 with old Maxima symbolics:
sage: var('x,y,z', ns=0); f = (x+y+z)^6 sage: timeit('(f*(f+1)).expand()') 5 loops, best of 3: 106 ms per loop
IN SAGE-3.4.2 with new symbolics:
sage: var('x,y,z', ns=1); f = (x+y+z)^6 (x, y, z) sage: timeit('(f*(f+1)).expand()') 5 loops, best of 3: 206 ms per loop
This may be due to a change in the pynac layer, where it is calling out to Python for some reason, even though it shouldn't need to. 206ms is really unacceptable. It's much slower than Maxima itself, it's 63 times slower than Pynac *was* just a few months ago, and it's 367 times slower than Singular.
comment:5 Changed 10 years ago by
- Description modified (diff)
Bug/Issue?: Control-C doesn't work in some cases.