Re: Long start-up time of a program with include std/
- Posted by mattlewis (admin) Mar 11, 2012
- 1688 views
The std/console.e file adds many lines of code to your program; its includes have more includes amounting to about half of the entire standard library.
After compiling (euc) or binding, unused lines of library code are not included in your program.
I've occasionally thought about this issue. The standard library has gotten much bigger in 4.0, which is a good thing. We've tried to spread stuff out in a logical fashion, but a lot of the more sophisticated routines rely on other parts of the library. For instance, text routines are kept in std/text.e, and since text is stored as a sequence, it's not surprising that some text routines will be dependent on more generic sequence routines that exist in std/sequence.e.
I think that the solution is to do some dependency analysis in order to minimize the required footprint of any particular file in the standard library. Fortunately, the new scoping rules in 4.0 allow this to be done transparently to the coder who is using the standard library.
Euphoria includes a tool that can help with this, at least as far as documenting the inter-dependencies of the files and their routines. Eudis has options to build these graphs in an html document. This is far from a trivial job, but I think it's probably worth it.
Matt