ptr_container compiles slow

Hello! I'm using Visual C++ 6 (for an MFC-Project). When I include <boost\ptr_container\ptr_vector.hpp> in an Sourcefile, it takes over 11 seconds to compile (without less than 1 second!) If I really wanted to use ptr_containers in my Project, I would have to include it in many files. But then compilation takes too long... Are there any possibilities to speed this up? Alex -- View this message in context: http://www.nabble.com/ptr_container-compiles-slow-tf2225929.html#a6168364 Sent from the Boost - Users forum at Nabble.com.

Or another question: Why is ptr_vector _much_ slower than std::vector? Alex -- View this message in context: http://www.nabble.com/ptr_container-compiles-slow-tf2225929.html#a6171755 Sent from the Boost - Users forum at Nabble.com.

LionAM wrote:
Or another question: Why is ptr_vector _much_ slower than std::vector?
It brings in a number of headers *in addition to* <vector>. (<memory> and numerous boost headers for meta-programming and serialization). Furthermore, it require a litle bit meta-programming to allow the specific ptr_vector< nullable<T> > syntax. On visual C++ 8 I get (2.1 Ghz P3 CPU, 7200RPM harddisk): $ time cl /EHsc ptr_vector.cpp /I../boost/boost Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. ptr_vector.cpp Microsoft (R) Incremental Linker Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. /out:ptr_vector.exe ptr_vector.obj real 0m1.652s user 0m0.015s sys 0m0.031s For this sample program: #include <boost/ptr_container/ptr_vector.hpp> int main() { boost::ptr_vector<int> vec; vec.push_back( new int(42) ); return vec.size(); } With precompiled headers it can be much lower. Also note that a slow/unordered harddisk can affect compilation speed significantly. -Thorsten

LionAM ha escrito:
Hello! I'm using Visual C++ 6 (for an MFC-Project). When I include <boost\ptr_container\ptr_vector.hpp> in an Sourcefile, it takes over 11 seconds to compile (without less than 1 second!) If I really wanted to use ptr_containers in my Project, I would have to include it in many files. But then compilation takes too long... Are there any possibilities to speed this up?
Hello Alex, you might try using the precompiled headers option and adding #include <boost\ptr_container\ptr_vector.hpp> to the precomp header (usually "stdafx.h" for MFC projects). This usually speeds things up orders of magnitude. The drawback is that this feature is a little fragile in VC++ 6.0 and you might need to ocassionally do fresh rebuilds when the compiler chokes with strange error messages or ICEs. HTH, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

Hello Alex, you might try using the precompiled headers option and adding #include <boost\ptr_container\ptr_vector.hpp> to the precomp header (usually "stdafx.h" for MFC projects). This usually speeds
Thank you for your answer! When I insert #include <boost\ptr_container\ptr_vector.hpp> in stdafx.h, I get the error message (...)\vc98\include\utility(21) : fatal error C1001: internal compiler error which leads to template<class _T1, class _T2> struct pair { typedef _T1 first_type; typedef _T2 second_type; pair() : first(_T1()), second(_T2()) {}
pair(const _T1& _V1, const _T2& _V2) : first(_V1), second(_V2) {} template<class U, class V> pair(const pair<U, V> &p) : first(p.first), second(p.second) {} _T1 first; _T2 second; };
With ptr_list.hpp, the same error in file (...)\vc98\include\xstring(133) occurs. What can this be? Alex -- View this message in context: http://www.nabble.com/ptr_container-compiles-slow-tf2225929.html#a6173398 Sent from the Boost - Users forum at Nabble.com.

LionAM ha escrito:
Hello Alex, you might try using the precompiled headers option and adding #include <boost\ptr_container\ptr_vector.hpp> to the precomp header (usually "stdafx.h" for MFC projects). This usually speeds
Thank you for your answer!
When I insert #include <boost\ptr_container\ptr_vector.hpp> in stdafx.h, I get the error message
(...)\vc98\include\utility(21) : fatal error C1001: internal compiler error
which leads to template<class _T1, class _T2> struct pair { typedef _T1 first_type; typedef _T2 second_type; pair() : first(_T1()), second(_T2()) {}
pair(const _T1& _V1, const _T2& _V2)
: first(_V1), second(_V2) {} template<class U, class V> pair(const pair<U, V> &p) : first(p.first), second(p.second) {} _T1 first; _T2 second; };
With ptr_list.hpp, the same error in file (...)\vc98\include\xstring(133) occurs. What can this be?
Well, looks like the unstability problems of VC++ 6.0 and PCHs I told you about in my previous post. You might want to try deleting the *.pch file in your Debug (or Release) directory and building again. A little more drastically, erase the entire Debug or Release directory before rebuilding (can take very long the first time.) Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

Joaquín Mª López Muñoz wrote:
more drastically, erase the entire Debug or Release directory before rebuilding (can take very long the first time.)
The error occurs in every project, also in new ones and console applications. Complete Rebuilding or deleting doesn't change anything... -- View this message in context: http://www.nabble.com/ptr_container-compiles-slow-tf2225929.html#a6173960 Sent from the Boost - Users forum at Nabble.com.

LionAM wrote:
Joaquín Mª López Muñoz wrote:
more drastically, erase the entire Debug or Release directory before rebuilding (can take very long the first time.)
The error occurs in every project, also in new ones and console applications. Complete Rebuilding or deleting doesn't change anything...
Just a note: vc6 is not the most compliant compiler around, and it will have problems with some cornors of Boost.PtrContainer, especially in the new versions. I suggest you upgrade ASAP to at least 7.1 service pack 1. best regards Thorsten

Thorsten Ottosen-3 wrote:
Just a note: vc6 is not the most compliant compiler around, and it will have problems with some cornors of Boost.PtrContainer, especially in the new versions.
I suggest you upgrade ASAP to at least 7.1 service pack 1.
I know these problems, but unfortunately I'm programming on an university pc - and I'm neither the only user nor an administrator... Do you perhaps know a light-weight-Version of ptr_vector, which only has basic features? For example not having to dereference the iterator twice. And which deletes the data automatically when it is removed... Alex -- View this message in context: http://www.nabble.com/ptr_container-compiles-slow-tf2225929.html#a6176391 Sent from the Boost - Users forum at Nabble.com.

LionAM wrote:
Thorsten Ottosen-3 wrote:
Just a note: vc6 is not the most compliant compiler around, and it will have problems with some cornors of Boost.PtrContainer, especially in the new versions.
I suggest you upgrade ASAP to at least 7.1 service pack 1.
I know these problems, but unfortunately I'm programming on an university pc - and I'm neither the only user nor an administrator...
But surely you can contact your administrator to install a free version of say visual c++ 8?
Do you perhaps know a light-weight-Version of ptr_vector, which only has basic features? For example not having to dereference the iterator twice. And which deletes the data automatically when it is removed...
Nope, sorry. std::vector<boost::shared_ptr<t>> might be more lighter. -Thorsten

Thorsten Ottosen-3 wrote:
But surely you can contact your administrator to install a free version of say visual c++ 8?
Perhaps I could, but with this I could not use mfc. And it would be very much work to port it... Visual C++ 2005 came out to late. Alex -- View this message in context: http://www.nabble.com/ptr_container-compiles-slow-tf2225929.html#a6180733 Sent from the Boost - Users forum at Nabble.com.

There are good reasons that M$ has retired MFC. Why not try wxWidgets? LionAM wrote:
Thorsten Ottosen-3 wrote:
But surely you can contact your administrator to install a free version of say visual c++ 8?
Perhaps I could, but with this I could not use mfc. And it would be very much work to port it... Visual C++ 2005 came out to late.
Alex

Who told you that Microsoft "retired" MFC? To paraphrase Mark Twain, this talk of MFC demise is greatly exaggerated. They might not be not pushing it the way they're pushing their .NET stuff, but it's certainly still there. MFC is part of Visual C++ 2005, both the libraries and the wizards in the IDE. In fact, they released a new version of it with additional features [<http://msdn2.microsoft.com/en-us/library/ms235433.aspx>]. The breaking changes are very minimal [<http://msdn2.microsoft.com/en-us/library/ms244941.aspx>], so it ought to be possible to port an existing MFC app with little or no difficulty. Moshe
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Jeffrey Holle Sent: Thursday, September 07, 2006 3:22 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] ptr_container compiles slow
There are good reasons that M$ has retired MFC. Why not try wxWidgets?
LionAM wrote:
Thorsten Ottosen-3 wrote:
But surely you can contact your administrator to install a
free version
of say visual c++ 8?
Perhaps I could, but with this I could not use mfc. And it would be very much work to port it... Visual C++ 2005 came out to late.
Alex
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Moshe Matitya wrote:
Who told you that Microsoft "retired" MFC? To paraphrase Mark Twain, this talk of MFC demise is greatly exaggerated. They might not be not pushing it the way they're pushing their .NET stuff, but it's certainly still there. MFC is part of Visual C++ 2005, both the libraries and the wizards in the IDE. In fact, they released a new version of it with additional features [<http://msdn2.microsoft.com/en-us/library/ms235433.aspx>]. The breaking changes are very minimal [<http://msdn2.microsoft.com/en-us/library/ms244941.aspx>], so it ought to be possible to port an existing MFC app with little or no difficulty.
The only problem is, that mfc is not included in the express edition... If I use the includes and mfc42d.lib from Visual C++ 6, it compiles (after some changes), but produces an error on start (before reaching my source code). Alex -- View this message in context: http://www.nabble.com/ptr_container-compiles-slow-tf2225929.html#a6198608 Sent from the Boost - Users forum at Nabble.com.
participants (5)
-
Jeffrey Holle
-
Joaquín Mª López Muñoz
-
LionAM
-
Moshe Matitya
-
Thorsten Ottosen