Re: [boost] mcs::units informal review request

AMDG Noah Roberts wrote:
Matthias Schabel wrote:
Any input on optimizing the library would be most welcome - I expect that it should be possible to have code using quantities run exactly as fast as for built in types, but that remains to be proven...
So far that seems to run true if you use the highest optimization level for g++. In VC++ I'm finding otherwise.
The cause is probably that quantity defines a destructor. It does exactly what the compiler generated one does, so there is no reason to define it explicitly. Just comment it out. msvc refuses to inline any function that returns a type with a non-trivial destructor when exceptions are enabled. In Christ, Steven Watanabe

So far that seems to run true if you use the highest optimization level for g++. In VC++ I'm finding otherwise.
The cause is probably that quantity defines a destructor. It does exactly what the compiler generated one does, so there is no reason to define it explicitly. Just comment it out. msvc refuses to inline any function that returns a type with a non-trivial destructor when exceptions are enabled.
Stephen, Thanks for the suggestion - once I get my hands on a system with Visual C++, I'll give your idea a try and see if this improves the performance. Interesting non- feature, that... Matthias

Matthias Schabel wrote:
So far that seems to run true if you use the highest optimization level for g++. In VC++ I'm finding otherwise.
The cause is probably that quantity defines a destructor. It does exactly what the compiler generated one does, so there is no reason to define it explicitly. Just comment it out. msvc refuses to inline any function that returns a type with a non-trivial destructor when exceptions are enabled.
Stephen,
Thanks for the suggestion - once I get my hands on a system with Visual C++, I'll give your idea a try and see if this improves the performance. Interesting non- feature, that...
I'll try it this friday; or maybe I'll stay late some day sooner but it won't be tomarro. I don't know that it is the issue though since the original reason for trying to begin with was because mine was exhibiting bad performance so I wanted to compare; as you know, I didn't get that far because of the bug I posted about earlier (when I said in VC finding otherwise I should have specified I was only able to test my own, which shows same performance as yours with g++). My quantity object has no user defined destructor so it wouldn't trigger this kind of response. I'm almost positive there are some optimization switches that need to be turned on and both of us will want to document this for our libraries. I'm hoping that the compiler isn't too confused by the metaprogramming to be able to run its optimizer over it.
participants (3)
-
Matthias Schabel
-
Noah Roberts
-
Steven Watanabe