b2 configuration checks take long time

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

b2 configuration checks take long time

Boost - Build mailing list
Hi,

I have a very simple libs/gil/test/image_view/Jamfile

```
import testing ;

project
    : requirements
    <include>$(BOOST_ROOT)
    <include>..
    ;

test-suite "boost-gil-test-image-view"
    :
    [ run collection.cpp ]
    ;
```

The collection.cpp is just

```
int main() {}
```

In libs/gil/test, I run `b2 collection` first time.
I run `b2 collection` again.

What may be the reason it takes 15-18 seconds until I see this?

```
Performing configuration checks
    - default address-model    : 64-bit (cached)
    - default architecture     : x86 (cached)
    - symlinks supported       : yes (cached)
```

How can I speed up the b2 startup?

I'm observing this on WSL (Ubuntu Bionic, GCC 7.3), on very decent workstation.
I have no access to Linux native host to compare if perhaps the issue is
due to WSL filesystem poor performance.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: b2 configuration checks take long time

Boost - Build mailing list
AMDG

On 08/29/2018 01:13 PM, Mateusz Loskot via Boost-build wrote:

> I have a very simple libs/gil/test/image_view/Jamfile
>
> ```
> import testing ;
>
> project
>     : requirements
>     <include>$(BOOST_ROOT)
>     <include>..
>     ;
>
> test-suite "boost-gil-test-image-view"
>     :
>     [ run collection.cpp ]
>     ;
> ```
>
> The collection.cpp is just
>
> ```
> int main() {}
> ```
>
> In libs/gil/test, I run `b2 collection` first time.
> I run `b2 collection` again.
>
> What may be the reason it takes 15-18 seconds until I see this?
>

It's loading the xxx/build/ Jamfiles for all of boost,
not just your project.  It also scans all the xxx/include/
directories to set up the global include directory.

> ```
> Performing configuration checks
>     - default address-model    : 64-bit (cached)
>     - default architecture     : x86 (cached)
>     - symlinks supported       : yes (cached)
> ```
>
> How can I speed up the b2 startup?
>

Try inserting a Jamroot to block the extra work that Boost's
Jamroot is doing automatically.  This is a bad idea in
general, as the aforementioned work is important, but it
should be okay as long as you set up `b2 headers` beforehand
and do not use any separately compiled boost libraries.

> I'm observing this on WSL (Ubuntu Bionic, GCC 7.3), on very decent workstation.
> I have no access to Linux native host to compare if perhaps the issue is
> due to WSL filesystem poor performance.
>

In Christ,
Steven Watanabe
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: b2 configuration checks take long time

Boost - Build mailing list
On Wed, 29 Aug 2018 at 21:24, Steven Watanabe via Boost-build
<[hidden email]> wrote:

> On 08/29/2018 01:13 PM, Mateusz Loskot via Boost-build wrote:
> > ```
> > Performing configuration checks
> >     - default address-model    : 64-bit (cached)
> >     - default architecture     : x86 (cached)
> >     - symlinks supported       : yes (cached)
> > ```
> >
> > How can I speed up the b2 startup?
>
>
> Try inserting a Jamroot to block the extra work that Boost's
> Jamroot is doing automatically.  This is a bad idea in
> general, as the aforementioned work is important, but it
> should be okay as long as you set up `b2 headers` beforehand

Hi,

I've tried to apply the Jamroot trick, but without much success.
I did run `b2 headers`, as usual, as per our
https://github.com/boostorg/gil/blob/develop/CONTRIBUTING.md

Here is my Jamfile-s setup

1.  libs/gil/Jamfile

```
project boost-gil
    :
    requirements
        <toolset>gcc:<cxxflags>"-std=c++11"
        <toolset>clang:<cxxflags>"-std=c++11"
    ;

build-project test ;
```

2.  libs/gil/test/Jamfile

```
import testing ;

project
    : requirements
    <include>$(BOOST_ROOT)
    <include>.
    ;

test-suite "boost-gil-test-image-view"
    :
    [ compile image_view_concepts.cpp ]
    ;
```

##### Run b2 in lib/gil without local Jamroot trick

~/boost.wsl/libs/gil$ time b2
Performing configuration checks

    - default address-model    : 64-bit
    - default architecture     : x86
    - symlinks supported       : yes
...patience...
...found 1331 targets...
...updating 9 targets...
gcc.compile.c++
../../bin.v2/libs/gil/test/image_view/image_view_concepts.test/gcc-7.3.0/debug/image_view_concepts.o
**passed** ../../bin.v2/libs/gil/test/image_view/image_view_concepts.test/gcc-7.3.0/debug/image_view_concepts.test
...updated 9 targets...

real    0m35.011s
user    0m3.641s
sys     0m30.734s

~/boost.wsl/libs/gil$ time b2
Performing configuration checks

    - default address-model    : 64-bit (cached)
    - default architecture     : x86 (cached)
    - symlinks supported       : yes (cached)
...patience...
...found 1334 targets...

real    0m36.655s
user    0m2.641s
sys     0m33.781s


##### Run b2 in lib/gil with local lib/gil/Jamroot

~/boost.wsl/libs/gil$ cp $PWD/Jamfile $PWD/Jamroot

~/boost.wsl/libs/gil$ time b2
...found 14 targets...
...updating 2 targets...
gcc.compile.c++
test/image_view/bin/image_view_concepts.test/gcc-7.3.0/debug/image_view_concepts.o
In file included from test/image_view/image_view_concepts.cpp:9:0:
/usr/include/boost/gil/image_view.hpp: In instantiation of...

So, b2 is finding Boost headers installed system-wide.
To fix it and prefer super-project headers, in my case from ~/boost.wsl/boost
I have to update the local Jamroot adding to the project requirements
the root location:

<include>../../

Is that the right thing to do to apply the local Jamroot trick?


> and do not use any separately compiled boost libraries.

Yes, in this particular case I do not use compiled libraries.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: b2 configuration checks take long time

Boost - Build mailing list
AMDG

On 08/30/2018 02:25 AM, Mateusz Loskot via Boost-build wrote:
> On Wed, 29 Aug 2018 at 21:24, Steven Watanabe via Boost-build
> <snip>
> I have to update the local Jamroot adding to the project requirements
> the root location:
>
> <include>../../
>
> Is that the right thing to do to apply the local Jamroot trick?
>

Yes.  BOOST_ROOT is another thing that's defined
by Jamroot.

In Christ,
Steven Watanabe
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: b2 configuration checks take long time

Boost - Build mailing list
On Thu, 30 Aug 2018 at 15:24, Steven Watanabe via Boost-build
<[hidden email]> wrote:

> On 08/30/2018 02:25 AM, Mateusz Loskot via Boost-build wrote:
> > On Wed, 29 Aug 2018 at 21:24, Steven Watanabe via Boost-build
> > <snip>
> > I have to update the local Jamroot adding to the project requirements
> > the root location:
> >
> > <include>../../
> >
> > Is that the right thing to do to apply the local Jamroot trick?
> >
>
> Yes.  BOOST_ROOT is another thing that's defined
> by Jamroot.

That fits all pieces in place for this puzzle.
Thank you!

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build