On Mon, Nov 23, 2015 at 9:50 PM, Johan Holmberg <[email protected]> wrote:

> On Mon, Nov 23, 2015 at 11:18 AM, Ivan Nedrehagen <[email protected]>
> wrote:
>
>> Just an idea, as creating loads of new environments aren't unusual.
>> Perhaps caching the version like this would be impossible, but how about
>> caching results based on executable paths and arguments?
>> Regards,
>> Ivan Nedrehagen
>>
>>
>
> I think that was what my patch tried to do. If the parameter named "cc"
> had the value "gcc", the call to env.WhereIs(cc) returned "/usr/bin/gcc",
> and I used that full path as key in the dict caching the results. I just
> assumed that "/usr/bin/gcc --version" would return the same thing each time
> it was called. (perhaps WhereIs() is not the right way to find the absolute
> path of a program, but it seemed to work).
>
>
> On Mon, Nov 23, 2015 at 5:04 AM, Jason Kenny <[email protected]> wrote:
>
>> I make a new environments myself all the time. The trick is to Clone() a
>> new environment, not create a new one from scratch each time you need a new
>> one.
>> Jason
>>
>
>
> I hadn't realised that Clone() was much cheaper. I tried just now with
> Clone() and it works well for me, and is even slightly faster than my patch.
>

Clone creates a substitute environment from the original rather than
creating a branch new environment, so if you are only overriding a few
variables, then Clone is much cheaper memory and performance wise.


>
> /Johan Holmberg
>
>
> _______________________________________________
> Scons-dev mailing list
> [email protected]
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
>
_______________________________________________
Scons-dev mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev

Reply via email to