Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Boost.Timer #35

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add support for Boost.Timer #35

wants to merge 4 commits into from

Conversation

Malvineous
Copy link
Contributor

Hi Benoit,

I've just added support for Boost.Timer, so hopefully you can include this in the main distribution.

Thanks,
Adam.

This optimises the way libraries are searched for.  With a dynamic link,
the tag name is searched for independently of the library path.  This results
in approximately six times fewer attempted links.  For both dynamic and static
links, once a tag name and library path are found, the values are cached and
tried first when searching for subsequent libraries.  This results in a huge
speed increase for the second and later library checks.
@Malvineous
Copy link
Contributor Author

Hi again,

I've just added a second (unrelated) commit which optimises the searching of libraries. For dynamic linking, instead of searching each tag name in each possible linker path, it tells the linker to look in all paths for the given tag name, then once the tag is found it searches for the correct path. This reduces the number of attempted links by about six (plus an additional six or so checks on the end, depending on the number of valid search paths.) This makes it quite a bit faster to find the first Boost library. For static links the behaviour is unchanged.

On top of this, the tag name and library path are remembered, and tried first for subsequent library searches. Since most installs put all the libraries in the same location, this drastically improves the speed of finding the second and later libraries. In the event this doesn't find a match, the code will continue searching in the same way it always has.

In my test ./configure, the running time dropped from 40 seconds to 14 seconds, which is a very nice improvement, so I hope you will consider including this change in the main distribution too! It makes it much less painful to rerun ./configure when there are Boost libraries involved :-)

Cheers,
Adam.

@Malvineous
Copy link
Contributor Author

Thanks for your comments. I've prefixed each variable with boost_ and changed Boost.Timer to use AC_REQUIRE instead (sorry, I just copied the way the other tests did it.)

I've also moved the list of paths into $boost_all_paths. (I couldn't reuse $boost_all_ldpaths as each path has -L on the front there.) Note that it is no longer possible to have paths with spaces in (even when using --with-boost) however this is already not possible as the compiler parameters are not quoted, so hopefully it's no big deal.

@Malvineous
Copy link
Contributor Author

Any chance of getting this code merged in?

@DrMcCoy
Copy link
Contributor

DrMcCoy commented Jul 21, 2014

Hmm, the change doesn't even cleanly apply to the current master anymore. Any chance this could be fixed up and merged in?

I for one would be quite interested in anything that could speed up boost.m4. Right now, it is rather slow...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants