Thank you so much for trying!  I admit that I'm slightly disappointed by 
this improvement, because it really was a very silly mistake.

Anyway, for things like integrate((1-x)^1300*x, x, algorithm="fricas") with 
large output, on my computer, it takes
* 3.5 seconds to transfer the string produced in FriCAS to sage. 
* 4.2 seconds in total.

Note that the 3.5 seconds do *not* include producing the string in FriCAS.

Martin

On Sunday 21 April 2024 at 01:52:04 UTC+2 Nasser M. Abbasi wrote:

> "Do you know how to apply patches? If so, you just need to apply the patch 
> corresponding to the PR Martin mentioned. It's here:
> https://patch-diff.githubusercontent.com/raw/sagemath/sage/pull/37836.diff
> " 
>
> I did the following
>
> ----------------------------------------------
> pwd
>     /home/me/TMP/sage-10.3/src/sage/interfaces
>
> wget 
> https://patch-diff.githubusercontent.com/raw/sagemath/sage/pull/37836.diff
>
> patch fricas.py 37836.diff 
>
> patching file fricas.py
> Hunk #1 succeeded at 802 (offset -1 lines).
> Hunk #2 succeeded at 1715 (offset -1 lines).
> Hunk #3 succeeded at 1993 (offset -1 lines).
> Hunk #4 succeeded at 2018 (offset -1 lines).
> Hunk #5 succeeded at 2049 (offset -1 lines).
> Hunk #6 succeeded at 2066 (offset -1 lines).
> ---------------------------------------
>
> Re-run 2 test files., One had 700 integrals and one had 3,000 integrals.
>
> The one with 3,000 integrals had improved mean time from 0.09 seconds per 
> integral
> to 0.07 seconds per integral. The one with 700 integrals improved the time 
> from 0.23 seconds to
> 0.21 seconds. 
>
> Will wait for official sage 10.4 to be out and may be next version of 
> Fricas and Maxima
> to do a full rebuild as it takes me 2-3 months to redo everything. But it 
> seems the patch
> did speed things from this limited test.
>
> --Nasser
> On Saturday, April 20, 2024 at 1:45:52 PM UTC-5 Dima Pasechnik wrote:
>
>> On Sat, Apr 20, 2024 at 7:31 PM 'Nasser M. Abbasi' via FriCAS - computer 
>> algebra system <fricas...@googlegroups.com> wrote:
>>
>>> Hello Matrin,
>>>
>>> Sure, will try your version on a large integration test file and see if 
>>> it is faster than the what I had with 10.3 sage.
>>>
>>> The problem is that I know nothing about github.  I just know how to 
>>> login to github and enter bug reports on the CAS systems I use at the 
>>> issues page. That is all.
>>>
>>> When I build sagemath, I download the sagemath latest zip file from 
>>> https://mirrors.mit.edu/sage/devel/index.html 
>>>
>>> I have no idea how to do what you said "try the branch at" . I do not 
>>> know what this means. 
>>>
>>> I see on the link you gave no zip file for sagemath to download.
>>>
>>> If you could give me a link to sagemath zip file with your fixes in it, 
>>> will be happy to download it, build it like I did for 10.3 and try it.
>>>
>>
>> Do you know how to apply patches? If so, you just need to apply the patch 
>> corresponding to the PR Martin mentioned. It's here:
>> https://patch-diff.githubusercontent.com/raw/sagemath/sage/pull/37836.diff
>>
>>
>>  
>>
>>>
>>> One day I want to take course at school how to use github if I can find 
>>> one.
>>>
>>
>> It doesn't have much to do with GitHub, it's git that you need to know a 
>> bit about.
>> GitHub is just a hosting platform for git repositories.
>>
>> HTH
>> Dima
>>
>>>
>>> --Nasser
>>>
>>> On Saturday, April 20, 2024 at 8:12:00 AM UTC-5 axio...@yahoo.de wrote:
>>>
>>>> Hi Nasser,
>>>>
>>>> could you try the branch at https://github.com/sagemath/sage/pull/37836?  
>>>> It should give significant performance gains for your testsuite.
>>>>
>>>> Best wishes,
>>>>
>>>> Martin
>>>>
>>>> On Friday 19 April 2024 at 11:49:49 UTC+2 Dima Pasechnik wrote:
>>>>
>>>>> On Fri, Apr 19, 2024 at 01:26:27AM -0700, 'Martin R' via FriCAS - 
>>>>> computer algebra system wrote: 
>>>>> > I don't know how to do it. Note that this should really work with 
>>>>> any lisp 
>>>>> > implementation to make sense, because some people (eg., me) will 
>>>>> have 
>>>>> > fricas installed with sbcl (because this is fastest), and the 
>>>>> interface 
>>>>> > shouldn't insist on an ECL installation. 
>>>>> > 
>>>>> > Do you know how to do it? 
>>>>>
>>>>> There is https://github.com/quil-lang/sbcl-librarian 
>>>>> which relies on a recent 
>>>>> https://www.sbcl.org/manual/#Calling-Lisp-From-C 
>>>>>
>>>>> If SBCL is the preferred Lisp then this route can be pursued - 
>>>>> I don't however know enough about FriCAS to see how to use 
>>>>> sbcl-librarian to call FriCAS functions from Python. 
>>>>> (There doesn't even seem to be an example on calling FriCAS from its 
>>>>> underlyng Lisp available anywhere - from that it should be doable) 
>>>>>
>>>>> I don't think it can be totally Lisp-agnostic: 
>>>>> SBCL does not allow embedding in the way ECL does (It's Embeddable 
>>>>> Common Lisp for a reason...) 
>>>>>
>>>>> Dima 
>>>>>
>>>>>
>>>>> > 
>>>>> > Martin 
>>>>> > 
>>>>> > On Thursday 18 April 2024 at 23:53:10 UTC+2 Dima Pasechnik wrote: 
>>>>> > 
>>>>> > 
>>>>> > 
>>>>> > On 18 April 2024 21:51:34 BST, 'Martin R' via FriCAS - computer 
>>>>> algebra 
>>>>> > system <fricas...@googlegroups.com> wrote: 
>>>>> > >OK, I think I have to give up. The InputForm consists of 23 964 324 
>>>>> > >atoms. I guess that there is no sensible way to transmit this, 
>>>>> right? 
>>>>> > 
>>>>> > In-memory - just how Maxima library interface is operating. 
>>>>> > No need for pexpect interface then. 
>>>>> > Create a FAS module loadable into libecl, 
>>>>> > and, well, you have a huge increase in speed of the interface. 
>>>>> > 
>>>>> > 
>>>>> > > 
>>>>> > >Martin 
>>>>> > >On Thursday 18 April 2024 at 21:50:57 UTC+2 Martin R wrote: 
>>>>> > > 
>>>>> > >> I have now FriCAS with ECL, but I now realize that I am doing 
>>>>> very silly 
>>>>> > >> things in the interface between FriCAS to sage: 
>>>>> > >> * I do an unnecessary unparse of the InputForm (this runs forever 
>>>>> on 
>>>>> > ECL, 
>>>>> > >> and crashes sbcl) 
>>>>> > >> * I throw the result away 
>>>>> > >> * I convert the InputForm into a string using a customized 
>>>>> printer 
>>>>> > >> * I parse the result 
>>>>> > >> 
>>>>> > >> Oh dear, what did I do! 
>>>>> > >> 
>>>>> > >> I guess that I was scared of creating a very long history in the 
>>>>> FriCAS 
>>>>> > >> process if I transmit the InputForm atom by atom. I guess I 
>>>>> should cook 
>>>>> > up 
>>>>> > >> a simple protocol to transmit an ordered tree, maybe as a Stream. 
>>>>> > >> 
>>>>> > >> Martin 
>>>>> > >> On Thursday 18 April 2024 at 21:03:34 UTC+2 Nasser M. Abbasi 
>>>>> wrote: 
>>>>> > >> 
>>>>> > >>> These are useful lisp commands, I did not know about them. This 
>>>>> is what 
>>>>> > I 
>>>>> > >>> get for my Fricas installation 
>>>>> > >>> 
>>>>> > >>> FriCAS Computer Algebra System 
>>>>> > >>> Version: FriCAS 1.3.10 built with sbcl 2.3.11 
>>>>> > >>> Timestamp: Wed Jan 10 09:37:52 PM CST 2024 
>>>>> > >>> 
>>>>> > >>> (1) -> )lisp (lisp-implementation-version) 
>>>>> > >>> Value = "2.3.11" 
>>>>> > >>> (1) -> )lisp (sb-ext:dynamic-space-size) 
>>>>> > >>> 
>>>>> > >>> Value = 4294967296 
>>>>> > >>> 
>>>>> > >>> I am also running Fricas and sagemath on VBox under windows 10. 
>>>>> The OS 
>>>>> > is 
>>>>> > >>> Linux Manjaro 
>>>>> > >>> 
>>>>> > >>> >fricas --version 
>>>>> > >>> FriCAS 1.3.10 
>>>>> > >>> based on sbcl 2.3.11 
>>>>> > >>> >sage --version 
>>>>> > >>> SageMath version 10.3, Release Date: 2024-03-19 
>>>>> > >>> > 
>>>>> > >>> On Thursday, April 18, 2024 at 12:01:19 PM UTC-5 
>>>>> axio...@yahoo.de 
>>>>> > wrote: 
>>>>> > >>> 
>>>>> > >>>> Hi Waldek! 
>>>>> > >>>> 
>>>>> > >>>> Thanks for the rapid answer! 
>>>>> > >>>> 
>>>>> > >>>> I have: 
>>>>> > >>>> )lisp (lisp-implementation-version) 
>>>>> > >>>> 2.1.11.debian 
>>>>> > >>>> )lisp (sb-ext:dynamic-space-size) 
>>>>> > >>>> 1073741824 
>>>>> > >>>> )version 
>>>>> > >>>> FriCAS 2022-07-16 compiled at Fr 12 Aug 2022 15:17:27 CEST 
>>>>> > >>>> 
>>>>> > >>>> I'm currently compiling the ECL version. 
>>>>> > >>>> 
>>>>> > >>>> Unfortunately, because of the MacOS problem ( 
>>>>> > >>>> https://github.com/sagemath/sage/pull/37041) most sage users 
>>>>> won't use 
>>>>> > >>>> the newest FriCAS. So I'll first check whether that makes a 
>>>>> > difference. 
>>>>> > >>>> 
>>>>> > >>>> Martin 
>>>>> > >>>> 
>>>>> > >>>> On Thursday 18 April 2024 at 18:11:21 UTC+2 Waldek Hebisch 
>>>>> wrote: 
>>>>> > >>>> 
>>>>> > >>>>> On Thu, Apr 18, 2024 at 08:45:53AM -0700, 'Martin R' via 
>>>>> FriCAS - 
>>>>> > >>>>> computer algebra system wrote: 
>>>>> > >>>>> > I started to look into one of the problems 
>>>>> > >>>>> > (https://github.com/sagemath/sage/issues/37813): 
>>>>> > >>>>> > 
>>>>> > >>>>> > res := 
>>>>> integrate((x^2+1)^(1/2)/(x^2+(x+(x^2+1)^(1/2))^(1/2)), x); 
>>>>> > >>>>> > 
>>>>> > >>>>> > works nicely, but converting to InputForm (which I use to do 
>>>>> the 
>>>>> > >>>>> > translation to sage) fails. Is there a good reason for that 
>>>>> - i.e., 
>>>>> > >>>>> is 
>>>>> > >>>>> > this a bug, or just a problem with memory? 
>>>>> > >>>>> > 
>>>>> > >>>>> > Best wishes, 
>>>>> > >>>>> > 
>>>>> > >>>>> > Martin 
>>>>> > >>>>> > 
>>>>> > >>>>> > (2) -> inform := res :: INFORM 
>>>>> > >>>>> > 
>>>>> > >>>>> > Heap exhausted during garbage collection: 0 bytes available, 
>>>>> 16 
>>>>> > >>>>> requested. 
>>>>> > >>>>> <snip> 
>>>>> > >>>>> > Total bytes allocated = 1072734880 
>>>>> > >>>>> > Dynamic-space-size bytes = 1073741824 
>>>>> > >>>>> 
>>>>> > >>>>> For me it works. The result is big for humans, but should be 
>>>>> no 
>>>>> > >>>>> problem for modern computers. I am using FriCAS trunk build 
>>>>> > >>>>> using sbcl-1.2.4 (currently with 3Gb limit). Tried also 
>>>>> version 
>>>>> > >>>>> with 2Gb limit and sbcl-2.2.9 with 1Gb limit. Note 
>>>>> > >>>>> I did: 
>>>>> > >>>>> 
>>>>> > >>>>> res := integrate((x^2+1)^(1/2)/(x^2+(x+(x^2+1)^(1/2))^(1/2)), 
>>>>> x); 
>>>>> > >>>>> ii := res::InputForm; 
>>>>> > >>>>> 
>>>>> > >>>>> that is I am _not_ printing resulting InputForm. But I also 
>>>>> > >>>>> separately printed the InputForm, it works, just is slow when 
>>>>> > >>>>> printing to terminal and useless because the result is much 
>>>>> > >>>>> bigger than terminal scrollback buffer. 
>>>>> > >>>>> 
>>>>> > >>>>> -- 
>>>>> > >>>>> Waldek Hebisch 
>>>>> > >>>>> 
>>>>> > >>>> 
>>>>> > > 
>>>>> > 
>>>>> > -- 
>>>>> > You received this message because you are subscribed to the Google 
>>>>> Groups "FriCAS - computer algebra system" group. 
>>>>> > To unsubscribe from this group and stop receiving emails from it, 
>>>>> send an email to fricas-devel...@googlegroups.com. 
>>>>> > To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/fricas-devel/49a360d1-f38a-4477-bd90-43be950ecd16n%40googlegroups.com.
>>>>>  
>>>>>
>>>>>
>>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "FriCAS - computer algebra system" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to fricas-devel...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/fricas-devel/d27c981d-32e7-4743-b1af-00dabdb6384en%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/fricas-devel/d27c981d-32e7-4743-b1af-00dabdb6384en%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/de06e15b-641a-431b-9346-24795e883f56n%40googlegroups.com.

Reply via email to