Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ performance: lists and iterators
    primarykey
    data
    text
    <p>I've got some inherited in-house C++ code, which when compiled with VC++ on Windows, runs an order of magnitude faster than when compiled with g++ on Linux (5 minutes vs. 2 hours). This remains the case both with and without the "normal" optimization flags, as well as over a few different versions of each compiler and respective platform, all on comparable hardware.</p> <p>Building a debug/profile version (-g -pg) on Linux with g++, I see the following three areas are consuming most of the time:</p> <pre><code>% cumulative self self total time seconds seconds calls Ks/call Ks/call name 31.95 955.93 955.93 3831474321 0.00 0.00 std::_List_const_iterator&lt;xxFile&gt;::operator!=(std::_List_const_iterator&lt;xxFile&gt; const&amp;) const 22.51 1629.64 673.71 3144944335 0.00 0.00 std::_List_const_iterator&lt;xxFile&gt;::operator++() 15.56 2095.29 465.65 686529986 0.00 0.00 std::iterator_traits&lt;std::_List_const_iterator&lt;dtFile&gt; &gt;::difference_type std::__distance&lt;std::_List_const_iterator&lt;xxFile&gt; &gt;(std::_List_const_iterator&lt;xxFile&gt;, std::_List_const_iterator&lt;xxFile&gt;, std::input_iterator_tag) </code></pre> <p>(The xxFile class consists of ints, floats, doubles, bools, and strings)</p> <p>My naive guesses are that there's something poorly coded which VC++ is compensating for or that the GNU STL may not be as optimized. I'm currently working on compiling the g++/Linux version with the Boost library, starting with assign/std/list.hpp and the boost::assign namespace.</p> <p>I'm unable to share the code, but does something obvious (besides my limited C++ experience) jump out as the cause, based on your experience?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload