|
Boost : |
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-07-06 14:44:25
> In article <000f01c2251b$d61f85d0$7772e50c_at_c161550a>,
> Paul Mensonides <boost_at_[hidden]> wrote:
> >Right now, we are having to provide pre-expanded files to include if
> >the preprocessor is from EDG.
>
> Yes, I noted this too, but forget to include it in my earlier post.
>
> I'm also curious for the full path of an article that Dave A wrote
> about a year ago about compile speeds.
>
> >Peprocessing in non-strict mode (on Win32) can be significantly
> >faster (though not *fast*) than preprocessing in strict mode.
> >Why is this and what is the difference?
>
> Nothing off hand leaps out at me. Permit me to ask some
> counter questions:
> 1) You're talking about the difference in como -E'ing it?
Yes.
> 2) How are you timing this?
--timing
> 3) When you say "non-strict mode (on Win32)" are you talking
> about general non-strict "relaxed" mode, or "microsoft" mode?
I mean the difference between the following...
como --A --preprocess --timing test.cpp > test.i
como --preprocess --timing test.cpp > test.i
...so I guess between strict and micrcsoft mode. Sorry for the lack of clarity.
:(
> 4) How "significant" is "significantly"? :) IOWs, can you give
> a timing example just to gain your perspective?
It depends of the complexity. Here is an example:
---------------
#define XYZ(n, _) BOOST_PP_COMMA_IF(n) _ ## n
#define ABC(n, _) BOOST_PP_COMMA_IF(n) ( BOOST_PP_REPEAT(BOOST_PP_INC(n), XYZ,
_) )
BOOST_PP_REPEAT(20, ABC, T)
BOOST_PP_REPEAT(20, ABC, T)
// etc. expanding it 30 times successively
---------------
This produces:
(T0), (T0, T1), (T0, T1, T2), ...
como --A --preprocess --timing test.cpp > test.i
// takes about 35 seconds on my machine
como --preprocess --timing test.cpp > test.i
// takes about 27 seconds on my machine
cl /P -I %BOOST_ROOT% test.cpp
// takes <= a second on my machine (BOOST_ROOT is my own environment
variable)
> I'm sure you guys have this right, but I'm trying to understand
> the details of it.
I don't know why the time is so different, everything seems to be working the
same in both strict mode and microsoft mode. ??
By the way, I like the way that Comeau C++ (I don't know about other
EDG-preprocessors) removes the directive lines from the preprocessor output.
Also, it would be helpful if error messages like "too many parameters in macro
invocation" and "not enough parameters in macro invocation" actually said
*which* macro invocation specifically.
Paul Mensonides
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk