On Fri, Jun 21, 2019 at 10:39 AM Sébastien Labbé <[email protected]> wrote: > > Ok so here is an easy way to reproduce the sleep problem: > > With topcom installed, I get a bunch of sleep calls when I compute the volume > of a triangle: > > sage: p = Polyhedron([(0,1/3),(0,1),(1/3,1)]) > sage: %prun p.volume() > > 750 function calls (749 primitive calls) in 0.216 seconds > > Ordered by: internal time > > ncalls tottime percall cumtime percall filename:lineno(function) > 5 0.201 0.040 0.201 0.040 {time.sleep} > 3 0.006 0.002 0.006 0.002 {posix.read}
yes, I can reproduce this. I think it's stuff in src/sage/geometry/triangulation/point_configuration.py that plays fast and loose with "engine" parameter. Basically, this is a great illustration that pexpect interface (what's topcom using) is slow... Let us fix this https://trac.sagemath.org/ticket/28037 > 1 0.004 0.004 0.004 0.004 {posix.forkpty} > 4 0.001 0.000 0.001 0.000 {select.select} > 1 0.000 0.000 0.001 0.001 > point_configuration.py:1291(volume) > 2 0.000 0.000 0.215 0.107 > point_configuration.py:671(_TOPCOM_communicate) > 1 0.000 0.000 0.216 0.216 base.py:5201(volume) > 21 0.000 0.000 0.000 0.000 {posix.lstat} > 1 0.000 0.000 0.010 0.010 ptyprocess.py:172(spawn) > 1 0.000 0.000 0.000 0.000 matrix_space.py:720(__call__) > 1 0.000 0.000 0.000 0.000 ptyprocess.py:152(__init__) > 1 0.000 0.000 0.000 0.000 > matrix_space.py:432(__classcall__) > 2 0.000 0.000 0.214 0.107 > point_configuration.py:597(_TOPCOM_exec) > 1 0.000 0.000 0.216 0.216 <string>:1(<module>) > 6 0.000 0.000 0.000 0.000 expect.py:13(new_data) > 4 0.000 0.000 0.002 0.001 expect.py:91(expect_loop) > 4 0.000 0.000 0.000 0.000 contextlib.py:21(__exit__) > 1 0.000 0.000 0.000 0.000 {method 'close' of '_io.FileIO' > objects} > 4 0.000 0.000 0.000 0.000 ptyprocess.py:670(isalive) > 1 0.000 0.000 0.000 0.000 > matrix_space.py:103(get_matrix_class) > 4 0.000 0.000 0.000 0.000 > spawnbase.py:192(compile_pattern_list) > 2 0.000 0.000 0.101 0.050 pty_spawn.py:526(send) > 21 0.000 0.000 0.000 0.000 posixpath.py:132(islink) > 3 0.000 0.000 0.000 0.000 base.py:2062(dim) > > -- > 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 post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sage-devel. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-devel/2b4c27bd-ee66-4814-8502-bcf9889dd888%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-devel. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq2t7-9FnJ8zMThrndv-YXq66C%2B7Xpc9iE6FnY3oDuyHTg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
