Re: [sage-support] Faster sage command line startup?

92 views
Skip to first unread message

arshpreet singh

unread,
Jun 28, 2012, 8:14:46 PM6/28/12
to sage-s...@googlegroups.com
can you please elaborate what exactly you are asking?

On Thu, Jun 28, 2012 at 11:56 AM, Peng Yu <peng...@gmail.com> wrote:
> Hi,
>
> sage command line usage is kind of slow. Is there a way to speed it up? Thanks!
>
> ~/linux/test/sage/print$ time ./main.sage
> xxx
>
> real    0m3.265s
> user    0m1.221s
> sys     0m0.825s
> ~/linux/test/sage/print$ cat main.sage
> #!/usr/bin/env sage
>
> print "xxx"
>
> #print factor(35)
> ~/linux/test/sage/print$ ll main.sage
> -rwxr-xr-x 1 pengy staff 52 2012-06-28 01:24:54 main.sage
>
> Regards,
> Peng
>
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org



--

Thanks
Arshpreet singh
http://arshpreetsingh.wordpress.com/

Minh Nguyen

unread,
Jun 28, 2012, 8:14:46 PM6/28/12
to sage-s...@googlegroups.com, Peng Yu
Hi Pen,

On Thu, Jun 28, 2012 at 4:26 PM, Peng Yu <peng...@gmail.com> wrote:
> sage command line usage is kind of slow. Is there a way to speed it up?

There has been some work on this issue. See

http://trac.sagemath.org/sage_trac/ticket/8254

--
Regards,
Minh Van Nguyen
http://bit.ly/mvngu

Ivan Andrus

unread,
Jun 29, 2012, 2:18:32 AM6/29/12
to sage-s...@googlegroups.com
If you want something really fast you can look into sage-forker which simply starts a shell session, then forks when ever you ask for another session:

https://github.com/jasongrout/sage-forker

I have used it in the past and it worked quite well. The biggest problem for me was that `sage -c` didn't take advantage of it so it was still terribly slow.

I'm hoping that once the new ipython is installed it will be possible to start an ipython kernel (will all of sage loaded of course), and then connect to it for `sage -c` and for starting a new terminal session. It's quite possible that I don't understand ipython though. Perhaps someone more familiar with ipython can weigh in.

-Ivan

Jason Grout

unread,
Jun 29, 2012, 9:16:27 AM6/29/12
to sage-s...@googlegroups.com
On 6/29/12 1:18 AM, Ivan Andrus wrote:
> If you want something really fast you can look into sage-forker which
> simply starts a shell session, then forks when ever you ask for
> another session:
>
> https://github.com/jasongrout/sage-forker
>
> I have used it in the past and it worked quite well. The biggest
> problem for me was that `sage -c` didn't take advantage of it so it
> was still terribly slow.
>
> I'm hoping that once the new ipython is installed it will be possible
> to start an ipython kernel (will all of sage loaded of course), and
> then connect to it for `sage -c` and for starting a new terminal
> session. It's quite possible that I don't understand ipython though.
> Perhaps someone more familiar with ipython can weigh in.
>

Here are a couple of caveats:

1. the sage-forker mentioned above has some issues that I have
programmed around, but I haven't had time to post yet. These are things
like the random number seed is not set, directories are not changed, etc.

2. In the old version of the Sage cell server, we implement a model for
forking a new Sage process when needed.

3. In the new Sage cell server, we take advantage of the IPython
architecture to implement a general way to fork to create new kernels.
We hope to clean up this code and submit it to IPython, so it will be as
easy as Ivan describes.

Thanks,

Jason

Reply all
Reply to author
Forward
0 new messages