[Scons-users] Improve speed of windows environment
Bill Deegan
bill at baddogconsulting.com
Tue Apr 23 16:46:41 EDT 2019
While the way that Mats' suggests will eventually get you there, there's
easier ways..
If you look at SCons/Tools/__init__.py there's a function named
tool_list(), if you look in that it's not too hard to find the default
tools for your platform.
Note that you don't need all of them.
I've replied separately with the likely list of tools you need.
If that's not sufficient, please reply with whatever error message you get
and we'll assist, or come ask on IRC.
On Tue, Apr 23, 2019 at 2:35 PM Mats Wichmann <mats at wichmann.us> wrote:
> On 4/23/19 11:48 AM, Pierre-Luc Boily wrote:
> > Ok, I tried your solution but scons complains that Object doesn't
> > exist, (which is normal I know). 2 Stupids questions:
> >
> > 1- What is the difference between tools and builders in the
> > environment? By doing this :
> > DefaultEnvironment(tools=[])
> > env=Environment(tools=[],...)
> >
> > both tools and builders are now empty.
>
> if the builder needs a tool and the tool is not found, then you don't
> get the builder.
>
> you need to deduce the tools you do need and give them in the
> Enviroment() call. That's not necessarily trivial to figure out, I
> don't think there's a published mapping, but you certainly need a
> compiler and linker.
>
> The standard tool modules call the functions that create the associated
> builders, so for example we see:
>
> SCons/Tool/link.py calls SCons.Tool.createSharedLibBuilder(env),
> SCons.Tool.createProgBuilder(env) and
> SCons.Tool.createLoadableModuleBuilder(env)
>
> while SCons/Tool/cc.py calls SCons.Tool.createObjBuilders(env)
>
> The downside with doing it this way is that it becomes OS-specific; for
> Windows you need msvc, mslink and mslib tools, and so on.
>
> >
> > 2- I need env.Object, env.Library env.Program, but those are gone from
> > the BUILDERS section. How to I add them when I create the Environment?
> > Tried this, but that doesn't work :
> > sconsEnv = SCons.Environment.Environment(MSVC_VERSION = '10.0',
> > TARGET_ARCH = 'x86', tools=['Object'])
> >
> > Thank you very much!
> >
> > Pierre-Luc
> >
> >
> > Le mar. 23 avr. 2019, à 10 h 54, Bill Deegan <bill at baddogconsulting.com
> > <mailto:bill at baddogconsulting.com>> a écrit :
> >
> > Yes.
> > This has long been the case.
> > Launching processes in Windows is MUCH slower than linux.
> > When SCons starts up it tries to load all the default tools.
> > This involves launching numerous processes to see what tools are
> > available and also which version(s)
> > You can speed this up by only loading the tools you're using on
> windows.
> >
> > Do you only use env.Program() or do you also use Program() (which
> > uses the DefaultEnvironment())
> > So:
> > DefaultEnvironment(tools=[])
> > env=Environment(tools=[only the tools you're using],...)
> >
> > Should help.
> >
> > -Bill
> >
> >
> >
> > On Tue, Apr 23, 2019 at 10:07 AM Pierre-Luc Boily
> > <pierreluc.boily at gmail.com <mailto:pierreluc.boily at gmail.com>>
> wrote:
> >
> > Hello!
> >
> > I just realized that the creation of an environment is faster
> > under centos
> > compared to windows 10. See below Dump trace with --deubg=time
> > arguments :
> >
> > Centos : https://pastebin.com/UPggyDcj
> > Windows : https://pastebin.com/11YzKNDH
> >
> > I already read somewhere that tool creation is time consuming,
> > but both
> > centos\windows environments looks similar to be regarding
> > tools.. So, I
> > don't know why windows takes 1500 ms compare to 300ms for centos.
> >
> > Any idea?
> >
> > thx!
> >
> >
> >
> > --
> > Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
> > _______________________________________________
> > Scons-users mailing list
> > Scons-users at scons.org <mailto:Scons-users at scons.org>
> > https://pairlist4.pair.net/mailman/listinfo/scons-users
> >
> > _______________________________________________
> > Scons-users mailing list
> > Scons-users at scons.org <mailto:Scons-users at scons.org>
> > https://pairlist4.pair.net/mailman/listinfo/scons-users
> >
> >
> > _______________________________________________
> > Scons-users mailing list
> > Scons-users at scons.org
> > https://pairlist4.pair.net/mailman/listinfo/scons-users
> >
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20190423/815ccd60/attachment-0001.html>
More information about the Scons-users
mailing list