giac startup

Librairie C++ de calcul formel/ C++ symbolic computation library

Modérateur : xcasadmin

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

giac startup

Message par jocaps » mer. août 30, 2017 10:33 am

Hi,

I am using giac from giacpy and I am wondering (I believe this is more a giac issue) why the startup is pretty slow. In general this is not an issue but having a faster startup would make life a bit easier. For instance, running a giacpy program one waits around 1-2 seconds to just get the text
Help file doc/fr/aide_cas not found
Added 0 synonyms
Help file /home/fred/dev/windows/share/giac/aide_cas not found
Help file aide_cas not found
after which the program gets executed. I know this is a minor issue but it does not hurt to optimize the startup speed (is there a configuration I need to setup to optimize this? e.g. the search for help file is unnecessary for me and I could benefit from bypassing it manually). Running giac/icas to execute a script from terminal/command-line has the same behaviour (slow startup trying to search for help files). It would be great if we could have the startup profiled. Is there anyway this can be improved without putting too much work into it?

Just to compare: Executing a pari from python (python library developed by Anton Mellit) or a pari/gp-script in command line by running gp with the same computer starts rather fast (definitely much below one second).

Jose

parisse
Messages : 5731
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: giac startup

Message par parisse » mer. août 30, 2017 2:15 pm

I'm not convinced it's the help request. On my computer I get the following timings:

Code : Tout sélectionner

time python ../tmp/test
Help file doc/fr/aide_cas not found
Added 0 synonyms

real	0m0.414s
user	0m0.372s
sys	0m0.030s

time icas 1
// Using locale /Applications/usr/share/locale/
// fr_FR.UTF-8
// /Applications/usr/share/locale/
// giac
// UTF-8
// Maximum number of parallel threads 1
Help file /Applications/usr/share/giac/doc/fr/aide_cas not found
Added 0 synonyms
1
// dclock2 0.00042
// Time 0
// Total time 0

real	0m0.157s
user	0m0.059s
sys	0m0.030s
The native app takes some time to initialize (C++ code vs C code in pari/gp), and the python/giac interface requires also some time.

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

Re: giac startup

Message par jocaps » ven. sept. 01, 2017 11:15 am

parisse a écrit : native app takes some time to initialize (C++ code vs C code in pari/gp), and the python/giac interface requires also some time.
Thank you for your analysis of the startup time. I also realized (independent of python), when I called a simple c++ program linked to giac, I get a similar overhead. But, since this is not yet very urgent for me and since I do not know what is causing this (I am also not convinced that it is C++ vs C code alone) I will not bother with this at the moment. I shall write back if I discover anything new that could help. Thank you in any case.

BTW: on another note. Just to report, I realized that in config.h HAVE_PARI_PARI_H has absolutely no effect.

parisse
Messages : 5731
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: giac startup

Message par parisse » ven. sept. 01, 2017 4:24 pm

Yes, it's automatically generated by the GNU autoconfiguration tools.

Répondre