From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-07-28 07:12:39
I'm currently considering some optimization, and posting my ideas to the list
to benefit from peer review.
Looking at the bjam profile on my project, I see that IMPORT and RULENAMES
builtins take a lot of time. The possible reason is this: each class instance
is actually a module. So, "import" statements inside classes are executed
once for each instance. And wholesale imports like
import target ;
cause V2 to
1. finding all rules in "targets" via RULENAMES
2. importing them all via "IMPORT"
which is probably the cause. My guess is backed up by the fact that there are
only 7000 instances created, while RULENAMES is called 36000 times. It can't
be due to loading of ordinary modules.
I propose to introduce new builtin IMPORT_MODULE. After "IMPORT_MODULE b " is
called in module a, "b" will be added to the list of imported modules. Name
lookup for rule will work like this:
- lookup the rule in this module
- if not found, and name is in the form something1.something2 and "something1"
is in the list of imported modules, look for "something2" in module
I think this should reduce memory usage and time needed for RULENAMES/IMPORT.
Are there any pitfalls I've missed?
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk