On Mar 1, 1:56 pm, luisfe <lftab...@yahoo.es> wrote:
>
> Yes, it is not used much. Ideally, the way of improving sage
> startuptime would be:
>
> 1.- On first execution by a user, create a pickle of lazy_import of
> the global names and save it in the .sage directory. This should not
> be slower than current startup.
>
> 2.- Then, following executions of sage would only load that pickle
> instead of reading hundreds of different files. This will translates
> the delay from the start to the first call of the function. But note
> that you will never call each global name so globally should be
> faster...
>
> 3.- That pickle should be updated under certain conditions. By a
> command, each time sage is updated etc.

This idea seems to be related to the zip-file and is orthogonal to
which callables should be imported lazily. Is this faster than the zip-
file?
Perhaps one could zip all the pickles, unzip the file in memory and
unpickle from this stream ;-)

>
> Note that currently there are lazy_import(...) in the startup of sage,
> but this command does not avoid disk access of the file, only
> execution/compilation of the module to import. That is why it has
> currently low impact.

I might have overlooked something, but as far as I can see,
lazy_import does no disk access until the lazily imported callable is
accessed. The initialiser of the object does nothing but set a few
fields, and only in the private _get_object is the actual import done;
this function is called whenever some access is needed. Anyway, a lazy
importer should and could surely have this feature.
Also, where is the lazy_import used, apart from in sage.sets.family
and sage.categories.sets_cat?

Johan

-- 
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