On 2/23/11 6:43 AM, Volker Braun wrote:
I take it that the slow thing is reading ~2000 sage library files from a
harddisk into the filesystem cache. I'm using SSDs and Sage starts
consistently within about 1 second. There is "sage -startuptime" to profile.

The way I see it, the only way to make a significant dent into the startup
time is either psychological (show a prompt and read in the backgroupnd) or
save the whole Sage session into a single file on the first startup and read
it from there (can you pickle a python session? ;-)

Recently I learned about strace, which can show the system calls that a process uses. When running sage through strace, we realized that there are a huge number of system calls that are just looking for where certain files are (e.g., python checking lots of different directories for where a module might be). It seemed that there was a huge amount of time spent in just looking up where files were. We wondered if there was a way to have a cache of file locations (or maybe even the files themselves) so that there didn't have to be so many seeks to disk just trying to find where a module was located. Especially in our case, where we (usually) have a static python tree, it seems silly to always be trying to find where a file is every time we start up.

Here is the command:

strace -f -r sage 2> test.out

(or on a mac, I think you use dtruss or one of the dtracing commands (see man -k dtrace) instead of strace)

Thanks,

Jason


--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to