On Thu, 15 Dec 2022 at 01:42, Dima Pasechnik <[email protected]> wrote: > > > > On Wed, 14 Dec 2022, 21:06 Vincent Delecroix, <[email protected]> > wrote: >> >> Note that in #34850 I execute the very same command, namely >> pari("quadclassunit(1 - 2^100)"), once in a fresh python session and >> once preceeded by "import sage.all". So whatever linking and whatever >> threading option has been used to compile pari these are the same for >> both executions. > > > > oops, sorry, I was too quick. I guess here it is a change in memory layout > that causes the slowdown.
I don't quite believe it. The PARI/GP stack is allocated before the `import sage.all` and is not affected by this call. What kind of change in memory could cause the slowdown here? > You also mention that it might be ipython - can this be tested by building > Sage without it? I meant the base kernel from ipython that would be responsible for the slowdown in pari_jupyter. That is just a supposition. >> In particular, I do not see any relations between >> #31572 (which tests two pari versions) and #34850 (which tests a >> single pari version). Could you either read carefully the description >> of #34850 or explain the link between #31572 and #34850 if any? >> >> On Wed, 14 Dec 2022 at 21:58, Dima Pasechnik <[email protected]> wrote: >> > >> > Does #31572 actually mean that pari threads are more harmful than useful? >> > If so, perhaps, we can create a special multithreaded, differerently >> > named, libpari for giac, and >> > build our "main" libpari single-threaded? >> > >> > Dima >> > >> > On Wed, Dec 14, 2022 at 8:38 PM David Roe <[email protected]> wrote: >> > > >> > > It could be related to #31572, which notes a dramatic speed regression >> > > based on pari being compiled with pthread. >> > > David >> > > >> > > On Wed, Dec 14, 2022 at 3:30 PM Dima Pasechnik <[email protected]> wrote: >> > >> >> > >> I vaguely recall something about the way gp is built, without linking >> > >> libpari dynamically, and something about gp getting slower if built >> > >> with threads. >> > >> >> > >> So, probably, more info is needed on how exactly your comparisons are >> > >> done, in regard of using, or not, threads, and dynamic linking. >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> On Wed, 14 Dec 2022, 20:23 Vincent Delecroix, >> > >> <[email protected]> wrote: >> > >>> >> > >>> Dear all, >> > >>> >> > >>> Some strange phenomenon makes execution of PARI/GP up to twice slower >> > >>> when ran inside a Python process compared to its execution in GP. >> > >>> Though this is not systematic, in a fresh python environment timing >> > >>> are comparable with GP. >> > >>> >> > >>> The slowdown has been first observed in the context of pari_jupyter >> > >>> [1] and then with cypari2 when sage.all is loaded [2]. There is a >> > >>> short code snippet in the description of [2] that you can try on your >> > >>> own sage version (must be ran with "sage -python" and not "sage"). >> > >>> >> > >>> Any idea on what could be the source of the slowdown or some profiling >> > >>> advices would be very welcome. >> > >>> >> > >>> [1] https://github.com/sagemath/pari-jupyter/issues/27 >> > >>> [2] https://trac.sagemath.org/ticket/34850 >> > >>> >> > >>> Best >> > >>> Vincent >> > >>> >> > >>> -- >> > >>> 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 it, send >> > >>> an email to [email protected]. >> > >>> To view this discussion on the web visit >> > >>> https://groups.google.com/d/msgid/sage-devel/CAGEwAAm_%2BVfg%3D6po8-7B4eb7kW2UT%3DHjvXaR7yfUOxL930HhQQ%40mail.gmail.com. >> > >> >> > >> -- >> > >> 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 it, send >> > >> an email to [email protected]. >> > >> To view this discussion on the web visit >> > >> https://groups.google.com/d/msgid/sage-devel/CAAWYfq2yJEvXbRa8znksXtDm%2B-hkXN_EVpwN09X4tb8EY-0-kA%40mail.gmail.com. >> > > >> > > -- >> > > 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 it, send >> > > an email to [email protected]. >> > > To view this discussion on the web visit >> > > https://groups.google.com/d/msgid/sage-devel/CAChs6_mqWOpnHAe4-cYTxg63y5ri4vFuJxZRasMUzsEMYzTNAQ%40mail.gmail.com. >> > >> > -- >> > 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 it, send an >> > email to [email protected]. >> > To view this discussion on the web visit >> > https://groups.google.com/d/msgid/sage-devel/CAAWYfq0dH8%3DTp1z_owfAbCw-ED_W%3DHjuh0NQp%2B9MUatapfxKXw%40mail.gmail.com. >> >> -- >> 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 it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sage-devel/CAGEwAAmj4FkYzJC07v80S%3DqU%3DVOH8vtysU%3Dg5tOs10-qV8Sqxg%40mail.gmail.com. > > -- > 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 it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-devel/CAAWYfq1QWbtX07O_ZD4Jotjf1XrT9u_BdRuMiS_d7mPXjz2Z7w%40mail.gmail.com. -- 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 it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAGEwAA%3DmHuOF%3DbERuFY2s0gN4RkWdAxxBKObPZDfie-tfqWQyQ%40mail.gmail.com.
