Re: SCons very slow on GitHub actions

Bill Deegan <[email protected]> Mon, 28 Apr 2025 08:30:18 -1000
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAEyG4CFWFyq1ewVNvMDZ18aQBEoOLree4iCHKsZsVQjhKiB-xg@mail.gmail.com>
--===============4997162076331175635==
Content-Type: multipart/alternative; boundary="000000000000fc2e8c0633dae069"

--000000000000fc2e8c0633dae069
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Curious. Have you tried to compare the runtimes of each of the examples?
I wouldn't be surprised if one of the examples shows a much larger
difference in runtime than the others

Ok. I took a look.
Chances are the tests which are missing:

# Skip initializing any tools in the DefaultEnvironment
# as we're not using it.
DefaultEnvironment(tools=3D[])

Are the ones taking much longer on Windows.
This is because when SCons starts up it initializes the
DefaultEnvironment(), in particular MSVC initialization is low.
The above code tell's SCons basically we're not going to use it, so don't
initialize it.

There's also some logic to cache the MSVC initialization which could be
turned on.

Add this to your github actions .yml file:
env:
    SCONS_CACHE_MSVC_CONFIG: 1

In general the scons-examples are meant to be simple examples of different
SCons usage.
Not the most optimized for build time, as for some users this isn't an
issue for a simple build.
(especially if they're not on windows)

I just made a PR with these changes.
https://github.com/SCons/scons-examples/pull/8

I'll merge them, and then you can rebase/merge into your PR and let us know
if that improves things.


-Bill

On Mon, Apr 28, 2025 at 5:57=E2=80=AFAM Mats Wichmann <[email protected]> wr=
ote:

> On 4/28/25 07:42, Leonard de Ruijter wrote:
> > Dear Mats,
> >
> >
> > Thanks for your quick reply.
> >
> > You can find comparison times in https://github.com/LeonarddeR/scons-
> > examples/actions/runs/14706591575
> >
> > This uses the workflow file found in https://github.com/SCons/scons-
> > examples/pull/7
>
> as an aside, I see several of the packaging examples are broken. We
> moved most of these out of the manpage a while back to better align
> where things were done.  I've seen that tag attribute error before...
> suppose I should go poke at those again someday.
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>

--000000000000fc2e8c0633dae069
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Curious. Have you tried to compare the runtimes of ea=
ch of the examples?</div><div>I wouldn&#39;t be surprised if one of the exa=
mples shows a much larger difference in runtime than the others</div><div><=
br></div><div>Ok. I took a look.</div><div>Chances are the tests which are =
missing:</div><div><br></div><div># Skip initializing any tools in the Defa=
ultEnvironment <br># as we&#39;re not using it.<br>DefaultEnvironment(tools=
=3D[])</div><div><br></div><div>Are the ones taking much longer on Windows.=
</div><div>This is because when SCons starts up it initializes the DefaultE=
nvironment(), in particular MSVC initialization is low.</div><div>The above=
 code tell&#39;s SCons basically we&#39;re not going to use it, so don&#39;=
t initialize it.</div><div><br></div><div>There&#39;s also some logic to ca=
che the MSVC initialization which could be turned on.</div><div><br></div><=
div>Add this to your github actions .yml file:</div><div>env:<br>=C2=A0 =C2=
=A0 SCONS_CACHE_MSVC_CONFIG: 1</div><div><br></div><div>In general the scon=
s-examples are meant to be simple examples of different SCons usage.</div><=
div>Not the most optimized for build time, as for some users this isn&#39;t=
 an issue for a simple build.</div><div>(especially if they&#39;re not on w=
indows)</div><div><br></div><div>I just made a PR with these changes.</div>=
<div><a href=3D"https://github.com/SCons/scons-examples/pull/8">https://git=
hub.com/SCons/scons-examples/pull/8</a></div><div><br></div><div>I&#39;ll m=
erge them, and then you can rebase/merge into your PR and let us know if th=
at improves things.</div><div><br></div><div><br></div><div>-Bill <br></div=
></div><br><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr=
" class=3D"gmail_attr">On Mon, Apr 28, 2025 at 5:57=E2=80=AFAM Mats Wichman=
n &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<b=
r></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex=
;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 4/28/25 07:42,=
 Leonard de Ruijter wrote:<br>
&gt; Dear Mats,<br>
&gt; <br>
&gt; <br>
&gt; Thanks for your quick reply.<br>
&gt; <br>
&gt; You can find comparison times in <a href=3D"https://github.com/Leonard=
deR/scons-" rel=3D"noreferrer" target=3D"_blank">https://github.com/Leonard=
deR/scons-</a> <br>
&gt; examples/actions/runs/14706591575<br>
&gt; <br>
&gt; This uses the workflow file found in <a href=3D"https://github.com/SCo=
ns/scons-" rel=3D"noreferrer" target=3D"_blank">https://github.com/SCons/sc=
ons-</a> <br>
&gt; examples/pull/7<br>
<br>
as an aside, I see several of the packaging examples are broken. We <br>
moved most of these out of the manpage a while back to better align <br>
where things were done.=C2=A0 I&#39;ve seen that tag attribute error before=
... <br>
suppose I should go poke at those again someday.<br>
_______________________________________________<br>
Scons-users mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">Scons-users@scon=
s.org</a><br>
<a href=3D"https://pairlist4.pair.net/mailman/listinfo/scons-users" rel=3D"=
noreferrer" target=3D"_blank">https://pairlist4.pair.net/mailman/listinfo/s=
cons-users</a><br>
</blockquote></div>

--000000000000fc2e8c0633dae069--

--===============4997162076331175635==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users

--===============4997162076331175635==--